fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int rows;
  6. cout<<"Enter the Number of rows:";
  7. cin>>rows;
  8. cout<<"Half Pyramid using Alphabets: "<<endl;
  9.  
  10. for(int i=0;i<rows;i++){
  11. for(int j=0;j<=i;j++){
  12. cout<<(char)('A'+j)<<" ";
  13. }
  14. cout<<endl;
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5264KB
stdin
5
stdout
Enter the Number of rows:Half Pyramid using Alphabets: 
A 
A B 
A B C 
A B C D 
A B C D E