Contact Learn C
Copy

Program 149:Reverse Alpha Pyramid 5

Program 149:

#include<stdio.h>
main()
{
int i,j,left,right,k,rightcount,count,rows,alpha;
printf("Enter number of rows\n");
scanf("%d",&rows);
count=1;
left=64+rows;
right=63+rows;

for(i=rows;i>=1;i--)
{
    for(k=1;k<=count;k++)
    {
        printf(" ");
    }
    for(j=65;j<=left;j++)
    {
        printf("%c",j);
    }
    left--;
       if(i!=1)
       {
         for(j=65;j<=right;j++)
         {
            printf("%c",j);
         }
             
       }
        right--;
       printf("\n");
       count++;    
}
}
Explanation:

//Coming Soon...

Output:

Reverse Alpha Pyramid 5













 
Donate

Download App and Learn when ever you want

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