;

C Program to Print Alphabet Characters Half Pyramid


Tutorialsrack 03/11/2019 C

In this C program, we will learn how to write a program to print Alphabet characters half pyramid.

Here is the code of the program to print Alphabet characters half pyramid.

Code - C Program to Print Alphabet Characters Half Pyramid
/* C program to print Alphabet Characters half Pyramid
C program to print character pyramid as given below:
A 
B C 
D E F 
G H I J 
K L M N O
*/

#include <stdio.h>

int main()
{
    int i,j;
    char ch='A';
    
    for(i=1;i<=5;i++)
    {
        for(j=1;j<=i;j++)
        {
            printf("%c ",ch++);
        }
        printf("\n");
    }

    return 0;
}
Output

A
B C
D E F
G H I J
K L M N O

--------------------------------
Process exited after 0.05716 seconds with return value 0
Press any key to continue . . .


Related Posts



Comments

Recent Posts
Tags