The ones who are crazy enough to think they can change the world are the ones who do.
- Steve Jobs

C Alphabetic Pattern - 11

Why Alphabetic Pattern

In most of the MNC interview questions such as in Zoho interview questions, IVTL Infoview interview questions, Amazon interview questions, Google interview questions, Infosys interview questions and even in Voonik interview questions, We come across Alphabetic pattern questions with a probability of 1:5. We provide you a most commonly asked alphabetic pattern question for your interview preparation using C programming.

Lets code a C program to print following alphabetic pattern to have some fun.

Alphabetic pattern in C

C Program - Alphabet Pattern

We challenge you, the programmer to do the following alphabet pattern using C programming

c-alphabet-pattern.c
#include <stdio.h>
int main()
{
int a, i;
for(a = 69;a >= 65;a--)
{
for(i = a;i >= 65;i--)
{
printf("%c ", a);
}
printf("\n");
}
return 0;
}
E E E E E
D D D D
C C C
B B
A

Note:

Here we make use of ASCII value to print the above alphabetic pattern. The ASCII value of

  • E = 69
  • D = 68
  • C = 67
  • B = 66
  • A = 65

Here, the inner for loop takes care of both the alphabets to be printed and a way to print the alphabets generated by itself. Here the Purpose of outter for loop is to set destination alphabet for every new line.

Report Us

We may make mistakes(spelling, program bug, typing mistake and etc.), So we have this container to collect mistakes. We highly respect your findings.

Report