C++ program to print the following design

A
AB
ABC
ABCD
ABCDE

Code:
#include<iostream.h>
#include<conio.h>

void main()
{
int i,j,n;
char ch;
cout<<“How many lines(ex 5):”;
cin>>n;

for(i=0;i<n;++i)
{
for(j=0;j<i;++j)
{
ch=65+j;
cout<<ch;
}
cout<<“n”;
}
getch();
}

Leave a Reply

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