C Program to Print Inverse Pyramid of ABCD... in C | Pyramid of Alphabets in C | Reverse Pyramid in C | Reverse Triangle In C

C Program to Print Inverse Pyramid of ABCD... in C | Pyramid of Alphabets in C | Reverse Pyramid in C | Reverse Triangle In C | Reverse Pyramid of ABC in C Language, Printing ABCD Pyramid in C language





#include
 
main()
{
      char ch = 'A';
      int n, c, k, space = 0;
 
      scanf("%d", &n);
 
      for ( k = n ; k >= 1 ; k-- )
      {
          for ( c = 1 ; c <= space ; c++)
              printf(" ");
 
          space++;
 
          for ( c = 1 ; c <= k ; c++ )
          {
             printf("%c ", ch); 
             ch++;
          }
 
          printf("\n");
          ch = 'A';
      }
 
      return 0;
}




Output : 
A B C D E F G H
 A B C D E F G
  A B C D E F 
   A B C D E
    A B C D 
     A B C
      A B
       A




No comments:

Post a Comment