Alphabet Pattern in c

Write a c program to print following alphabet pattern:-
EEEEE
DDDD
CCC
BB
A

#include <stdio.h>

int main()
{
    int j,k;
    for(j=5;j>=1;j--)
    {
        for(k=1;k<=j;k++)
        {
            printf("%c",'A'-1 + j);
        }
        printf("\n");
    }
}

Related Posts