C Program to Implement Floyds Triangle
This is the Implementation of Floyd’s triangle in C,Enter the Number of Lines it will print the Triangle with Number
#include<stdio.h>
main()
{
int num=1;
int i,j,n;
printf("Enter the Number of Rowsn");
scanf("%d",&n);
for (i=0;i<=n;i++)
{
for (j=0;j<=i;j++)
{
printf("%d",num);
num++;
}
printf("n");
}
}
OUTPUT:
Enter the Number of Rows
5
1
23
456
78910
1112131415
161718192021
Recent Comments