+ 2

How can write program to print this figure by using loop

12345 678 910 11

22nd Apr 2017, 12:47 PM
Bts...
Bts... - avatar
6 Answers
+ 2
cout << "12345\n"; cout << "678\n"; cout << "910\n"; cout << "11\n";
22nd Apr 2017, 12:53 PM
CalviŐ˛
CalviŐ˛ - avatar
+ 2
by using loop
22nd Apr 2017, 1:21 PM
Bts...
Bts... - avatar
+ 2
what mean of true
22nd Apr 2017, 5:17 PM
Bts...
Bts... - avatar
+ 2
int i; for(i=1;i<=11;i++) { if(i==6) { cout>>"\n"; } if(i==9) { cout>>"\n"; } if(i==11) { cout>>"\n"; } cout<<i; }
23rd Apr 2017, 5:11 PM
vijay singh
+ 2
while (true) { cout << "12345\n"; cout << "678\n"; cout << "910\n"; cout << "11\n"; } Edit: true means an infinite loop in this program. This is a valid program that will cause an infinite loop.
23rd Apr 2017, 8:18 PM
Ty Ler
Ty Ler - avatar
+ 1
do{cout<<"12345\n678\n910\n11";}while(false);
23rd Apr 2017, 6:19 AM
MUHAMMAD WAQAS KHAN
MUHAMMAD WAQAS KHAN - avatar