This is a for loop program in which we are going to see how to print the above pattern of right angle triangle of a number/Floyd's Triangle, with the help of the C Programming language.
Â
#include <stdio.h>
void main()
{
int rows,number=1;
printf( "\nEnter the number of rows\n");
scanf("%d",&rows);
printf("\n");
for (int i = 1; i <= rows; i++)
{
for (int j = 1; j <= i; ++j)
{
printf("%d ", number);
++number;
}
printf("\n");
}
}
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP