//Write a program for Floyd's triangle.
#include<stdio.h>
#include<conio.h>
void main() {
int i,j,temp=1;
clrscr();
printf("Floyd's Triangle is:\n");
for(i=1;i<=4;i++)
{
for(j=1;j<=i;j++)
{
printf("%d ",temp);
temp++;
}
printf("\n");
}
getch();
}
Output:
Floyd's Triangle is:1
2 3
4 5 6
7 8 9 10