NOTE :
// indicates comments.This wont get printed in the output.This is used for for documentation purpose.
PROGRAM:
#include<conio.h>
#include<stdio.h>
void main()
{
int i,j,l,m,n,k=1;
clrscr();
printf("Enter the number of rows\t:\t");
scanf("%d",&n);
for(i=0;i<n;i++) //printing rows
{
for(j=0;j<=i;j++) //prints the floyd numbers
{
printf("%d ",k++);
}
printf("\n"); //next row
}
getch();
}
OUTPUT :
// indicates comments.This wont get printed in the output.This is used for for documentation purpose.
PROGRAM:
#include<conio.h>
#include<stdio.h>
void main()
{
int i,j,l,m,n,k=1;
clrscr();
printf("Enter the number of rows\t:\t");
scanf("%d",&n);
for(i=0;i<n;i++) //printing rows
{
for(j=0;j<=i;j++) //prints the floyd numbers
{
printf("%d ",k++);
}
printf("\n"); //next row
}
getch();
}
OUTPUT :


0 comments: