Number Magic2 Using For loop #c
The Output look like this 1 2 3 4 5 6 7 8 9 10 //Lets start the program #include<stdio.h> #include<conio.h> void main() { int j,k,b=31,c; clrscr(); for(c=9;c>=1;c=c-1,b=b+1) {printf("\n"); for(j=1;j<=b;j++) printf(" "); for(k=1;k<=c;k++) printf("%d ",c); } getch(); } Lets Start Next Program. The Out Will look like this. 1 2 3 4 5 6 7 8 9 10 //Lets Start the program. #include<stdio.h> #include<conio.h> void main() { int i,j,k,a=40; clrscr(); for(i=1;i<=9;i++,a=a-1) {printf("\n"); for(j=1;j<=a;j++) printf(" "); for(k=1;k<=i;k++) printf("%d ",i); } getch(); }