113. C Program to Print Number Triangle.
How does this program work?
- This Program is used to print the number triangle from the given pattern.
Here is the code
int main()
{
int i,j,k;
for(i=1;i<=5;i++)
{
j=i;
for( j=5;j>i;j--)
{
printf(" ");
}
for(k=1;k<=i;k++)
{
printf("%d",j++);
}
j-=2;
for(k=j;k>=i;k--)
{
printf("%d",j--);
}
printf("\n");
}
return 0;
}