0

Can anyone provide me a c++ program to print the following pattern using nested loops :

A A B A B C A B C D A B C D E

5th Dec 2017, 5:04 PM
pundarikaksh narayan tripathi
pundarikaksh narayan tripathi - avatar
2 Answers
+ 10
#include <iostream> using namespace std; int main() { char alph[] = "ABCDE"; for (int a = 0; a < 5; a++) { for (int b = 0; b <= a; b++) { cout<<alph[b]<<" "; } cout<<endl; } return 0; }
5th Dec 2017, 5:16 PM
Valen.H. ~
Valen.H. ~ - avatar
5th Dec 2017, 5:27 PM
#RahulVerma
#RahulVerma - avatar