Thursday, 19 December 2019

Floyd triangle in C

#include<stdio.h>
#include<conio.h>
int main()
{
int k=1,n,i,j;
printf("Enter the limit: ");
scanf("%d",&n);
printf("The floyds triangle is:\n");
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d ",k);
k++;
}
printf("\n");
}
}

No comments:

Post a Comment

Convey your thoughts to authors.