C program for the alphabet pattern "A, AB, ABC, ABCD, ABCDE,........"

#include<stdio.h>
#include<conio.h>
void main()
{
char i,j='A';
int x=0,n;
puts("Enter the number of rows");
scanf("%d",&n);
while(x<n)
{
for(i='A';i<=j;i++)
printf("%c ",i);
printf("\n");
j++;
if(j>'Z')
break;
x++;
}
}

Output of this program :-

Comments