c

mario harvard cs50

#include <stdio.h>
#include <cs50.h>
int main(void)
{

    int i = get_int("number: ");
    const int z = i;

    while (i > 0)
    {
        int n = i;
        while (n > 0)
        {
            printf(" ");
            n--;
        }
        int o = z;
        while (i <= o)
        {
            printf("#");
            o--;
        }

        printf("  ");

        int u = z;
        while (i <= u)
        {
            printf("#");
            u--;
        }


        i--;
        printf("\n");
    }

printf("\n");
}
Was this helpful?