#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int range, i, j, k=1;
printf("Enter the range (upto how many line ?) : ");
scanf("%d",&range);
printf("\nFloyd's Triangle :\n");
for(i=1; i<=range; i++)
{
for(j=1; j<=i; j++, k++)
{
printf("%d ",k);
}
printf("\n");
}
getch();
}
No comments: