WebSource
Pages
Home
JAVA
SE&STM
PPL
ADS
C
DAA
Friday, May 3, 2019
Write a C program to print the Floyd Triangle.
program:
#include<stdio.h>
main()
{
int n,i,j,k;
printf("enter a number:");
scanf("%d",&n);
k=1;
for(j=1;j<=n;j++)
{
for(i=1;i<=j;i++)
{
printf(" %d ",k); k++;
}
printf("\n");
}
}
output:-
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment