DarkWebCode is a place where you can find a lot of exciting and inspiring stuff about Web Development, Blogging, SEO and many more

Breaking

C Program to print half pyramid using alphabets

#include <stdio.h>
int main()
{
    int i, j;
    char input, alphabet = 'A';

    printf("Enter the uppercase character you want to print in the last row: ");
    printf("\n");
    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;
}


OUTPUT

Enter the uppercase character you want to print in the last row: H
A
BB
CCC
DDDD
EEEEE
FFFFFF
GGGGGGG
HHHHHHHH