Write a program to construct the image shown below.
1
22
3333
444444
555555555
66666666666
7777777777777
888888888888888
888888888888888
99999999999999999
#include <stdio.h>
#include <conio.h>
void main ( )
{
int i, j, k;
clrscr ( );
printf ("\n\t\t\t Design of Numbers");
printf ("\n\n\n");
for ( i = 1; i <= 9; i++ )
{
for ( k = 35; k >= i; k-- )
{
printf (" ");
}
for ( j = 1; j <= 2 * i - 1; j++)
{
printf ("%d", i);
}
printf ("\n");
}
getch ( );
}
Click here to contact us
No comments:
Post a Comment