Program to print triangle Pattern(◤) descending line width using numbers for n number of lines.[Pattern:10]| Using C language| C Program series 31|
👨💻Program to print triangle Pattern (◤) descending line width using numbers for n number of lines.[Pattern:10]
Code :
For n number of LINES:
/*
[Pattern 10]Program to print triangle Pattern using numbers for n number of lines.
For Example:n=5
12345
1234
123
12
1
*/
#include<stdio.h>
main()
{
printf("[Pattern 10]Program to print triangle Pattern using numbers for n number of lines.\n\n");
int i,j,n,temp;
//Here,
//temp for decrease value of n with first loop
//n for number
//i for row
//j for colomn
printf("Enter the number:");
scanf("%d",&n);
temp=n;
for(i=1;i<=n;i++,temp--)
{
for(j=1;j<=temp;j++)
{
printf("%d",j);
}
printf("\n");
}
}
The output of Code:
Comments
Post a Comment