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