How to print triangle using alphabets in c ?

#include<stdio.h>
int main ()
{
char i,j,k;
for(i=’A’;i<=’Z’;i++)
{
for(j=’A’;j<=i;j++)
printf(“%c”,j);
printf(“\n”);
}
}

Output of Program-

Leave a Reply