Code Box
-----------------------------------------------
/*program to print number pattern by while loop
5
54
543
5432
54321
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,j;
clrscr();
printf("\nEnter a value: ");
scanf("%d",&n);
i=n;
while(i>=1)
{j=n;
while(j>=i)
{
printf("%d",j);
j--;
}
printf("\n");
i--;
}
getch();
}
No comments:
Post a Comment