C programs to print Alphabet pattern | Alphabet pattern printing programs in C Language

C programs to print Alphabet pattern are asked in examinations. The purpose of these type of programs are to check the logic of the students and understanding of the outer and inners loops in the language. If you practice to solve Alphabet pattern printing programs ,your logic will be strong which is the motive of these type of programs.

C program to print Alphabet pattern – 1

Soure Code :

/* ----------------------------------------------------------------------------
 Program to print Alphabet pattern in C 
 by https://bptutorials.com 

------------------------------------------------------------------------------*/

#include<stdio.h>
void main()
{
    int row, column, n;
    printf("Enter the no of lines:");
    scanf("%d", &n);
    for(row=1;row<=n;row++)
    {
        for(column=1;column<=row;column++)
        {
            printf("%c",'A'-1 + row);
        }
        printf("\n");
    }
}

Input :

C programs to print Alphabet pattern | Alphabet pattern printing programs in C Language 1

Output :

C programs to print Alphabet pattern | Alphabet pattern printing programs in C Language 2

Triangle pattern of alphabet in C – 2

Source code :

/******************************************************************************
 Program to print pyramid of alphabets like below pattern
 By https://bptutorials.com
     
*******************************************************************************/
#include<stdio.h>
void
main ()
{
  int ch = 65;
  int r, col, k, m, n;
  printf ("Enter no of Lines :");
  scanf ("%d", &n);
  for (r = 1; r <= n; r++)
    {
      for (col = n; col >= r; col--)
	printf (" ");
      for (k = 1; k <= r; k++)
	printf ("%c", ch++);
      ch--;
      for (m = 1; m < r; m++)
	printf ("%c", --ch);
      printf ("\n");
      ch = 65;
    }
}

Input and Output :

C programs to print Alphabet pattern | Alphabet pattern printing programs in C Language 3
Share This!

Leave a Reply

Your email address will not be published. Required fields are marked *