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
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;
}
+ 1
Here is your answer:
https://code.sololearn.com/cAchGCeoFJfv/?ref=app