Write a C++ program to display the following pattern | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Write a C++ program to display the following pattern

A A B A B C A B C D

15th Feb 2017, 4:51 PM
Pathan Younus Khan
Pathan Younus Khan - avatar
1 Answer
+ 2
int a; for(int i = 0; i < 4; i++) { a = 65; for(int j = 0; j <= i; j++){ cout << static_cast<char>(a) << " "; a++; } cout << endl; }
15th Feb 2017, 5:01 PM
Yi Jing Chai
Yi Jing Chai - avatar