Contact Learn C
Copy Program Share Program

Program 74:Alpha Pyramid 4

Program 74:
 
#include<stdio.h>
main()
{
int i,j,left,right,k,rightcount,count,rows,alpha;
printf("Enter number of rows\n");
scanf("%d",&rows);
count=rows-1;
left=1;
right=0;
alpha=64;
for(i=1;i<=rows;i++)
{
    for(k=1;k<=count;k++)
    {
        printf(" ");
    }
    for(j=i;j<=left;j++)
      {
      printf("%c",alpha+j);
      }
      left+=2;
      if(i!=1)
      {
         for(j=right;j>=i;j--)
         {
            printf("%c",alpha+j);
         }
             
       }
        right+=2;
       printf("\n");
       count--;    
}
}

Explanation:

//Coming Soon...

 Output:

Alpha Pyramid 4

Download App and Learn when ever you want

Get it on PlayStore
Get it on Amazon App Store
Get it on Aptoide