C Library – stdbool.h
2 months ago
Photo Credit to CodeToFun
Here`s a program that prints the above alphabet pattern using C Programming:
#include <stdio.h>
int main()
{
int i, j;
for(i=65; i<=69; i++)
{
for(j=69; j>=i; j--)
printf("%c", j);
printf("\n");
}
return 0;
}
When you run the above program, it will print the following output:
EDCBA EDCB EDC ED E
Let's break down the logic behind the code:
Each row contains a decreasing sequence of letters, starting from 'E' and ending with 'A'. The number of letters in each row corresponds to the row number, with the first row having five letters and the last row having only one letter.
For over eight years, I worked as a full-stack web developer. Now, I have chosen my profession as a full-time blogger at codetofun.com.
Buy me a coffee to make codetofun.com free for everyone.
Buy me a Coffee
If you have any doubts regarding this article (C Alphabet Pattern 8) please comment here. I will help you immediately.