Output 1
2 2
3 3 3
#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,n,k;
clrscr();
printf("enter the no of terms");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=n;j>i;j--)
{
printf(" ");
}
for(k=1;k<=i;k++)
{
printf("%d ",i);
}
printf("\n");
}
getch();
return 0;
}
0 comments:
Post a Comment