#include<stdio.h>
#include<conio.h>
void main()
{
int i, j, no;
clrscr();
printf("Enter number: ");
scanf("%d", &no);
printf("1 \n");
for(i=1; i<=no-1; i++)
{
printf("1 ");
for(j=1; j<=i; j++)
{
printf("%d ", j*5);
}
printf("\n");
}
getch();
}
/*
Output:
Enter number: 5
1
1 5
1 5 10
1 5 10 15
1 5 10 15 20
*/
No comments:
Post a Comment