Program |
#include
void pyramid ( int );
void main ()
{
int n;
printf("Enter n value:\n");
scanf("%d",&n);
printf("\n");
pyramid(n);
}
void pyramid ( int n )
{
int i,j;
for ( i=0; ii; j-- )
printf(" ");
for ( j=i; j>=0; j-- )
printf("%d",j);
for ( j=1; j<=i; j++ )
printf("%d",j);
printf("\n");
}
}
|