Code Box
-----------------------------------------
/*program to print star pattern square box by while 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);
while(i<=n)
{j=1;
while(j<=n)
{
printf("%d",i);
j++;
}
printf("\n");
i++;
}
getch();
}
No comments:
Post a Comment