Half Pyramid of Alphabets

    0

    1

    Giovanny Gongora

    Codiga's C Recipes
    A
    B B
    C C C
    D D D D
    E E E E E
    
    #include <stdio.h>
    
    int main() {
      int i, j;
      char input, alphabet = 'A';
      printf("Enter an uppercase character you want to print in the last row: ");
      scanf("%c", &input);
      for (i = 1; i <= (input - 'A' + 1); ++i) {
        for (j = 1; j <= i; ++j) {
          printf("%c ", alphabet);
        }
        ++alphabet;
        printf("\n");
      }
      return 0;
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.