Print Number Patten in C
Hello friends here we Print Number Pattern in C. It is same like Star Pattern in C need for loop concept, print space on screen and new line(\n).
Print below Pattern
0987
654
32
1
#include<stdio.h>
#include<conio.h>
void main()
{
int num = 10;
int i,j;
for (i = 4; i > 0; i--)
{
for (j = 0; j < i; j++)
{
printf("%d", num % 10);
num--;
}
printf("\n");
}
getch();
}
No comments :
Post a Comment