amritansh22 / Data-Structures-and-Algorithms-in-cpp

This repository is in development phase and will soon provide you with c++ code of various data structures and algorithms
MIT License
366 stars 341 forks source link

Alphabet Triangle #556

Open nikhilsharma2020 opened 2 years ago

nikhilsharma2020 commented 2 years ago

include

using namespace std;
int main()
{
char ch='A';
int i, j, k, m;
for(i=1;i<=5;i++)
{
for(j=5;j>=i;j--)
cout<<" ";
for(k=1;k<=i;k++)
cout<<ch++;
ch--;
for(m=1;m<i;m++)
cout<<--ch;
cout<<"\n";
ch='A';
}
return 0;
}