How to print it | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to print it

I want to print this- 1 1 2 1 1 2 3 2 1 1 2 1 1

25th Mar 2017, 4:21 PM
Anirban Mukherjee
Anirban Mukherjee - avatar
4 Answers
+ 8
@reddylopes -_- What did you think,bro?
25th Mar 2017, 4:33 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 3
You can create the strings as an array: string drawing[5] = { " 1 ", " 1 2 1 ", "1 2 3 2 1", " 1 2 1 ", " 1 " } for(int c = 0; c < 5; c++) cout << drawing[c] << endl;
25th Mar 2017, 4:32 PM
reddylopes
reddylopes - avatar
+ 1
But I want it to be created by loops
26th Mar 2017, 12:54 PM
Anirban Mukherjee
Anirban Mukherjee - avatar
0
I'm sorry, you should have specified that. Check my profile for the answer, the code is a bit long to post here: https://code.sololearn.com/ciEHPJzI74dQ/#cpp
26th Mar 2017, 1:31 PM
reddylopes
reddylopes - avatar