C Program to implement Floyd's triangle - c program
//C Program to implement Floyd's triangle
#include <stdio.h>
#include <conio.h>
main()
{
int i,j,t,rows;
clrscr();
printf("enter the no, of rows");
scanf("%d",&rows);
t=1;
for(i=0;i<rows;i++)
{
for(j=0;j<=i;j++)
{
printf("%d \t", t)
t++
}
printf("\n")
}
getch();
}
#include <stdio.h>
#include <conio.h>
main()
{
int i,j,t,rows;
clrscr();
printf("enter the no, of rows");
scanf("%d",&rows);
t=1;
for(i=0;i<rows;i++)
{
for(j=0;j<=i;j++)
{
printf("%d \t", t)
t++
}
printf("\n")
}
getch();
}
No comments:
Post a Comment