Assignments of C-Lab
// program to print floyd's triangle till n lines
#include <stdio.h>
#include <conio.h>
void main()
{
int i = 1, n, b, j = 0;
printf("Enter number of lines to print floyd's triangle\n");
scanf("%d", &n);
for (; i <= n; i++)
{
for (b = 1; b <= i; b++)
{
j++;
printf("%d", j);
}
printf("\n");
}
getch();
}
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment
Note: Only a member of this blog may post a comment.