C program for triangle number pattern 12

C program for triangle number pattern 12

This program is to print triangle number pattern 12 in C.

5
45
345
2345
12345

If you need a dry run of the program or any other query, then kindly leave a comment in the comment box or mail me, I would be more than happy to help you.

Program

#include<stdio.h>
 
void main()
{
    int i,j,n;
 
    printf("Enter the no of lines\n");
    scanf("%d",&n);
 
    for(i=n;i>=1;i--)
    {
        for(j=i;j<=n;j++)
        {
            printf("%d",j);
        }
         printf("\n");
    }
}

Output

Share Me!