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 = &#x27;A&#x27;;
  7. printf("Enter the uppercase character you want to print in last row: ");
  8. scanf("%c",&inpt);
  9. for(i=1; i <= (inpt-&#x27;A&#x27;+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!
download android app

Popular C Examples









codesadda.com

Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube