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