- 1

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

Whats the answer? I put: for (int x = 0; x <= 20; x += 2) { cout << x << endl; The rest is fine, but 20 gives me wrong. What is the answer?

9th Dec 2020, 12:06 PM
PT
PT - avatar
2 Answers
+ 4
that seems correct !
9th Dec 2020, 12:10 PM
Hima
Hima - avatar
+ 2
I agree with Hima But If the number 20 is the reason youre wrong, Then change x <= 20 to x <= 18 although I cant be sure cause I dont know what the challenge/problem is.
9th Dec 2020, 12:22 PM
noteve
noteve - avatar