C Program to Print Half Pyramid Using Alphabet



In this program we will print half pyramid pattern using Alphabet



  1. //C program to print half alphabet pyramid
  2. #include <stdio.h>
  3. int main()
  4. {
  5. int i, j;
  6. char inpt, alpbet = 'A';
  7. printf("Enter the uppercase character you want to print in last row: ");
  8. scanf("%c",&inpt);
  9. for(i=1; i <= (inpt-'A'+1); ++i)
  10. {
  11. for(j=1;j<=i;++j)
  12. {
  13. printf("%c", alpbet);
  14. }
  15. ++alpbet;
  16. printf("\n");
  17. }
  18. return 0;
  19. }

Output


Output!