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