Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Half pyramid

Name: Anonymous 2010-03-07 1:09

How can I modify this code to output a half pyramid?


printf("Height\n");
    scanf("%d", &user_input);
    for(row = 1; row <= user_input; row++)
    {
        for (column = 1; column <= user_input * 2; column++)
        if (column <= user_input + x && column >= user_input - x)
            printf("*");
        else
            printf(" ");
            printf("\n");
            x++;

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List