FREE CODES
BYTES WITH LOGIC
Floyds Triangle program
#include
main()
{
int i,j,k,n;
k=0;
printf("Enter the limit : ");
scanf("%d",&n);
printf("\n\n\t\tFLOYDS TRIANGLE\n\n");
for(i=1;i<=n;i++)
{
for(j=i;j>=1;j--)
printf("%d\t",++k);
printf("\n");
}
}
sample output:
1
2 3
4 5 6
6 7 8 9
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment