C Program to print capital alphabets in right angled triangle pattern in series

Program

#include<stdio.h>
void main()
{
	int i, j, n;
	printf("Enter the number of rows to print\n");
	scanf("%d", &n);
	printf("Pattern\n");
	for(i = 1; i <= n; i++)
	{
		for(j = 1; j <= i; j++)
		{
			printf("%c", 'A' + (j - 1));
		}
		printf("\n");
	}
}

Output

Enter the number of rows to print
6
Pattern
A
AB
ABC
ABCD
ABCDE
ABCDEF