Sunday, 21 January 2018

Program for Phyramid 2

Program for Phyramid 2
#include<stdio.h>
#include<conio.h>
main()
{
int n,i,j,k;
clrscr();
printf("enter the number:");
scanf("%d",&n);
printf("\n\n\n\n\n\n\n");
for(i=1;i<=n;i++)
{

for(k=1;k<=40-i;k++)
printf(" ");
for(j=1;j<=2*i-1;j++)
printf("%d",j);
printf("\n");
}
getch();
}

0 comments:

Post a Comment