Contact Learn C
Copy

Program 164:Right Alpha Pyramid 3

Program 164:

#include<stdio.h>
main()
{
    int i,j,k,alpha=64,rows,temp,count;
    printf("Enter number of rows:\n");
    scanf("%d",&rows);
    printf("\n");
    count=rows-1;
    for(i=1;i<=rows;i++)
    {
     for(k=1;k<=count;k++)
     {
      printf(" ");
     }
        for(j=1;j<=i;j++)
        {
            printf("%c",alpha+j);            
        }     
  count--;   
        printf("\n");
    }  
   count=1;
 for(i=rows-1;i>=1;i--)
 {
  temp=1;
  for(k=1;k<=count;k++)
  {
   printf(" ");
  }
  for(j=i;j>=1;j--)
  {
   printf("%c",alpha+temp);
    temp++;
  }  
     count++;
  printf("\n");
 }  
}
Explanation:

//Coming Soon...

Output:

Right Alpha Pyramid 3

Donate

Download App and Learn when ever you want

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