Program to print triangle using numbers (◣) in descending order Pattern:5 for n number of lines.| Using C language| C Program series 26|
👨💻Program to print triangle using numbers (◣) in descending order Pattern:5 for n number of lines.
Code :
For n number of LINES:
/*
Program to triangle using numbers Pattern:5 in descending order for n number of lines.
For Example:n=8
1
21
321
4321
54321
654321
7654321
87654321
*/
#include<stdio.h>
main()
{
printf("Program to triangle using numbers Pattern:5 in descending order for n number of lines.\n\n");
int i,j,n;
//n for number
//i for row
//j for colomn
printf("Enter the number:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=i;j>0;j--)
{
printf("%d",j);
}
printf("\n");
}
}
The output of Code:
Comments
Post a Comment