#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,num_lines;
clrscr();
printf("\nEnter the number of lines to print: ");
scanf("%d", &num_lines);
for(i=1; i<=num_lines; i++)
{
for(j=1; j<=i; j++)
{
printf("%d ", j);
}
printf("\n");
}
getch();
}
#include<conio.h>
void main()
{
int i,j,num_lines;
clrscr();
printf("\nEnter the number of lines to print: ");
scanf("%d", &num_lines);
for(i=1; i<=num_lines; i++)
{
for(j=1; j<=i; j++)
{
printf("%d ", j);
}
printf("\n");
}
getch();
}
No comments:
Post a Comment