Program Source Code
#include"stdio.h"
#include"conio.h"
void main()
{
int i,j,n,k;
printf (“Enter the value of n”);
scanf(“%d”,&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=n-1;j++)
{
printf(“ ”);
}
for(k=1;k<=i;k++)
{
printf(“1”);
}
printf(“\n”);
}
getch();
}
3 comments:
i need a program to print
12
123
1234
12345
i need a program to print these numbers in triangle pattern
1
2 3
4 5 6
7 8 9 10
Post a Comment
Dont SPAM