C Program to Print Right Triangle of Incremental Alphabets Pattern

Write a C program to print right triangle of incremental alphabets pattern using for loop.

#include <stdio.h>

int main()
{
	int rows;

	printf("Enter Right Triangle of Incremented Characters Rows = ");
	scanf("%d", &rows);

	printf("Right Triangle of Incremented Row Characters Pattern\n");
	int alphabet = 65;

	for (int i = 0; i <= rows - 1; i++)
	{
		for (int j = i; j >= 0; j--)
		{
			printf("%c ", alphabet + j);
		}
		printf("\n");
	}
}
C Program to Print Right Triangle of Incremental Alphabets Pattern

This C program prints the right angled triangle pattern of incremental alphabets or ascending order using a while loop.

#include <stdio.h>

int main()
{
	int rows, i, j, alphabet;

	printf("Enter Right Triangle of Incremented Characters Rows = ");
	scanf("%d", &rows);

	printf("Right Triangle of Incremented Row Characters Pattern\n");

	alphabet = 65;

	i = 0;
	while (i <= rows - 1)
	{
		j = i;
		while (j >= 0)
		{
			printf("%c ", alphabet + j);
			j--;
		}
		printf("\n");
		i++;
	}
}
Enter Right Triangle of Incremented Characters Rows = 14
Right Triangle of Incremented Row Characters Pattern
A 
B A 
C B A 
D C B A 
E D C B A 
F E D C B A 
G F E D C B A 
H G F E D C B A 
I H G F E D C B A 
J I H G F E D C B A 
K J I H G F E D C B A 
L K J I H G F E D C B A 
M L K J I H G F E D C B A 

This C example uses the do while loop to print the angled triangle of alphabets in ascending order pattern.

#include <stdio.h>

int main()
{
	int rows, i, j, alphabet;

	printf("Enter Right Triangle of Incremented Characters Rows = ");
	scanf("%d", &rows);

	printf("Right Triangle of Incremented Row Characters Pattern\n");

	alphabet = 65;

	i = 0;
	do
	{
		j = i;
		do
		{
			printf("%c ", alphabet + j);

		} while (--j >= 0);

		printf("\n");

	} while (++i <= rows - 1);
}
Enter Right Triangle of Incremented Characters Rows = 16
Right Triangle of Incremented Row Characters Pattern
A 
B A 
C B A 
D C B A 
E D C B A 
F E D C B A 
G F E D C B A 
H G F E D C B A 
I H G F E D C B A 
J I H G F E D C B A 
K J I H G F E D C B A 
L K J I H G F E D C B A 
M L K J I H G F E D C B A 
N M L K J I H G F E D C B A 
O N M L K J I H G F E D C B A 
P O N M L K J I H G F E D C B A 

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.