Code Box
-------------------------------------
/*program to print number pattern square box by for loop
55555
44444
33333
22222
11111
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,j;
clrscr();
printf("\nEnter a value: ");
scanf("%d",&n);
for(i=n;i>=1;i--)
{
for(j=1;j<=n;j++)
{
printf("%d",i);
}
printf("\n");
}
getch();
}
No comments:
Post a Comment