Program for PHYRAMID


Program for PHYRAMID
#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");
for(i=1;i<=n;i++)
{
for(k=1;k<=n-i;k++)
printf(" ");
for(j=1;j<=2*i-1;j++)
printf("%d",j);
printf("\n");
}
getch();
}�

No comments:

Post a Comment