×
FREE ASSISTANCE FOR THE INQUISITIVE PEOPLE
Tutorial Topics
X
softetechnologies
Pyramid with numbers II
Pyramid with Alphabets - Pattern - C Language
3868    Arnab De    10/07/2019

Write a C Program to print the pattern shown in the figure [Pyramid Alphabets]

In this type of program we always find how many column present in a particular row. Because we know that we are always print in VDU horizontally. Here column number is same as (row number * 2 ) - 1 and the spacces are present at the right side of the character is equal to the (total no of row - current row). It is Pyramid which 1st row is A, 2nd row in B and so on.

softetechnologies
#include <stdio.h>


void main()
{
    int r,c,n,s;
    printf("Enter Total Number of row : ");
    scanf("%d",&n);
    
    for(r=1;r<=n;r++)
    {
        
        for(s=1;s<=n-r;s++)
        {
            printf(" ");
        }
		for(c=1;c<=2*r-1;c++)
        {
            printf("%c",r+64);
			
        }
        printf("\n");
    }
}

softetechnologies

OUTPUT :

Enter Total Number of row : 6

     A
    BBB
   CCCCC
  DDDDDDD
 EEEEEEEEE
FFFFFFFFFFF
softetechnologies
Pyramid with numbers II
softetechnologies
Author Details
Arnab De
I have over 16 years of experience working as an IT professional, ranging from teaching at my own institute to being a computer faculty at different leading institute across Kolkata. I also work as a web developer and designer, having worked for renowned companies and brand. Through tutorialathome, I wish to share my years of knowledge with the readers.
Enter New Comment
Comment History
No Comment Found Yet.
Albert Einstein
I have no special talent. I am only passionately curious.
Albert Einstein
2434
64.28
Today So Far
Total View (Lakh)
softetechnologies
26/05/2018     47382
25/06/2018     39477
01/01/2018     39090
28/06/2017     36982
02/08/2017     35708
01/08/2017     29943
06/07/2017     29728
15/05/2017     29214
14/07/2017     25097
11/09/2018     24243
softetechnologies