Loading...

mario.c


/**
 *To make mario game ladder 
 *Shubham kumar
 *sshubhamk1.page.tl
*/
 
#include <stdio.h>
#include <conio.h>
int main(void)
{
    int nstep, row, spac, step;
    // row=row num,spac=empty space in j,step=steps in j
    printf("Height: ");
    scanf("%d",&nstep);   
    for(row = 1; row <= nstep; row++) 
    { 
        if (row == 1) 
            continue;
        for(spac = nstep - row; spac >= 1; spac--)
            printf(" ");
        for(step = 1; step <= row; step++) 
            printf("#");
        printf("\n");
    }  
    getch(); 
}


123 Sample Rd, Samplington, SA 12345
(555) 0123