C++ program to print alphabet pyramid.
Jignesh Kothari
Posted on June 22, 2022
Here in the following I've shared the Code for printing alphabet pyramid.
#include <iostream>
using namespace std;
int main() {
int i,j,n,ch=64;
cout<<"Enter Value For Patten : ";
cin>>n;
for(i=1;i<=n;i++)
{
ch=64;
for(j=1;j<=i;j++)
{
ch+=1;
cout<<(char)ch;
}
cout<<"\n";
}
return 0;
}
Output:
Enter Value For Patten : 6
A
AB
ABC
ABCD
ABCDE
ABCDEF
💖 💪 🙅 🚩
Jignesh Kothari
Posted on June 22, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.