Search code snippets, questions, articles...

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?
0 Comments
Programming Feeds
Learn something new everyday on Devsheet