Fill in the blanks to print "this is a loop" to the screen 15 times. | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 1

Fill in the blanks to print "this is a loop" to the screen 15 times.

if you wont to print in the screen 15 time, you must set 16, the question is wrong i think Fill in the blanks to print "this is a loop" to the screen 15 times. i put int x = 1; do { cout << "this is a loop" << endl; x++; } while (x<= 16); and sees wrong, and the right one is 15, but is 14 times in to the screen

5th Feb 2017, 11:45 PM
Frantseko Mystakidis
Frantseko Mystakidis - avatar
10 ответов
+ 3
Because the conditional operator used is "equals to or less than"
5th Feb 2017, 11:56 PM
Wen Qin
Wen Qin - avatar
+ 2
15 and ++!
1st Jan 2020, 6:11 AM
Arjun Singhal
Arjun Singhal - avatar
+ 1
answer is 15 and ++
3rd Feb 2021, 7:40 PM
Prince Issar
Prince Issar - avatar
+ 1
Fill in the blanks to print "this is a loop" to the screen 15 times. int x = 1; do { cout << "this is a loop" << endl; x++; } while ( x <= 15 );
6th Apr 2022, 3:26 AM
Reza Anugrah
0
the question is print to the screen 15 times !!! if i put while(x<=15); i print to the screen 14 times !!! i think the question is wrong !!!
6th Feb 2017, 12:09 AM
Frantseko Mystakidis
Frantseko Mystakidis - avatar
0
The only wrong thing in your code is the while conditon. How you already initiate x with the value 1, the conditional needs to be: x < 16 OR x <= 15
6th Feb 2017, 12:09 AM
João Victor Oliveira Couto
João Victor Oliveira Couto - avatar
0
is a question in the courses, ant the question is Fill in the blanks to print "this is a loop" to the screen 15 times. to the screen 15 times if i put while (x<= 16); i print 15 times but the anser is wrong, and the right is while (x<= 15); but i print 14 times
6th Feb 2017, 12:14 AM
Frantseko Mystakidis
Frantseko Mystakidis - avatar
0
don't write silly comments because i need a answer!
1st Jan 2020, 6:06 AM
Arjun Singhal
Arjun Singhal - avatar
0
plz,can you stop?
1st Jan 2020, 6:08 AM
Arjun Singhal
Arjun Singhal - avatar
0
Fill in the blanks to print the numbers 0 through 5 using the do-while loop:
22nd Jul 2023, 4:06 AM
PRADEEN D
PRADEEN D - avatar