what is the for loop to print EVEN values from 0 to 20 using a for loop: | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 7

what is the for loop to print EVEN values from 0 to 20 using a for loop:

1st Nov 2016, 10:56 AM
Nandu Sasi
12 Answers
+ 11
Guys for everyone who thought it's the developers of this page's problem, it's not, because you have to put a semicolon after 20, the answers are: ; 20; 2 x
16th Dec 2020, 9:36 AM
BasharGh123
BasharGh123 - avatar
+ 5
for(int x=0;x<=20;x+=2){ cout<<x<<endl; } solution 2 for(int x=0;x<=21;x+=2){ cout<<x<<endl; }
4th Nov 2016, 1:57 PM
Joro Ignatov
Joro Ignatov - avatar
+ 3
for (int x = 0 x <= 20 x += ) { cout << << endl; When I enter 20 it says I am wrong but I can't see why?
11th Dec 2020, 2:19 PM
David Sneddon
+ 3
for (int x = 0 x <= 20 x += ) { cout << << endl; When I enter 20 it says I am wrong but I can't see why? Because You Forget ";" after 20 for (int x = 0; x <= 20; x +=2 ) { cout << x << endl;
20th Dec 2020, 11:39 PM
hadi ghiasi
hadi ghiasi - avatar
+ 2
for(int i = 0; i <= 20; i += 2) cout << i << " ";
1st Nov 2016, 11:28 AM
Daniel Oravec
Daniel Oravec - avatar
+ 2
Respuesta correcta: for (int x = 0; x < 20; x+=2) { Console.WriteLine(x); }
6th Apr 2019, 1:07 PM
Mario Alfonso Saucedo Gomez
Mario Alfonso Saucedo Gomez - avatar
+ 1
you can use while too for x%2=0 print something like that
1st Nov 2016, 11:54 AM
imaqtpie
imaqtpie - avatar
+ 1
Even mean increment 2 by 2..
18th May 2019, 3:10 PM
Mewan Athukorala
Mewan Athukorala - avatar
0
int a = 144; int b = 33; if (a > 12 b <= ) { cout << "You rock!" << endl; }
20th Jul 2018, 6:36 AM
Yusupov Elyor Erkinjon o'g'li
0
Fill in the blanks to print EVEN values from 0 to 20 using a for loop: var x = 0; for (; x <= 20; x += 2) { document.write(x); }
2nd Jul 2020, 6:53 AM
Rustamjon Kosimov
Rustamjon Kosimov - avatar
0
2
9th Dec 2020, 4:51 PM
tieflabs
tieflabs - avatar
0
what is the for loop to print EVEN values from 0 to 20 using a for loop: 20 2
13th Jan 2022, 3:54 PM
James Obinna