A
A B
A B C
A B C D
A B C D E
#include <iostream.h>
#include <conio.h>
void main()
{
char ch='A';
int n;
cout<< "\n Enter the height of the triangle :";
cin>> n;
for(int i=1; i< = n ; i++)
{
ch = 'A';
for(int j = 1; j< = i; j++)
{
cout<< ch<< " ";
ch++;
}
cout<< "\n";
}
getch();
}
No comments:
Post a Comment