+ 5

Fill in the blanks to print EVEN (multiples of 2) values from 0 to 20 using a for loop:

Under "The for Loop" lesson of the C++ Course, the following problem comes: "Fill in the blanks to print EVEN (multiples of 2) values from 0 to 20 using a for loop:" I get for (int x = 0; x <= 20; x +=2){ cout << x << endl; } And it says I am wrong for the "x <= 20" part. I don't know where I went wrong; please help.

12th Dec 2020, 9:55 PM
Chirag Samantaroy
6 Réponses
+ 20
when you entered the 20.....did you enter the semi-colon just after it?
12th Dec 2020, 10:25 PM
rodwynnejones
rodwynnejones - avatar
+ 3
you have to put 20; don't forget the semicolon (;)
14th Aug 2021, 6:57 PM
Moussa Rashaideh
Moussa Rashaideh - avatar
+ 2
oh my god i am dumb
24th Jun 2021, 12:38 PM
Phrog78
Phrog78 - avatar
+ 1
please add semicolon after 20. Just like 20;
12th Apr 2022, 12:56 PM
Alemu Gudeta Eticha
Alemu Gudeta Eticha - avatar
0
i was missed ;
27th Mar 2022, 8:55 AM
ASTEWUL BIRHANU MEKONNE
0
12th Sep 2022, 11:40 AM
Varatharaj C