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