anyone know c++

100 Dwarf Hunter
so i have this rather annoyingly stubborn online c++ class i have to take and the website we have to use for homework is terrible, and i am having trouble with this problem
"Write a for loop that prints the odd integers 11 through 121 inclusive, separated by spaces. "

what i have so far is
int x

for (x = 11; x <= 121; x += 2)

cout << x << " ";

and the error that comes up is "you seem to have an error in compilation"

they already have some code already put in

#include <iostream>
2 using namespace std;
4 main() {

at the beginning and

12 }

at the end
Reply Quote
90 Gnome Priest
You're missing a semi-colon after the
int x
Reply Quote
100 Dwarf Hunter
and i feel dumb now. thanks
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Explain (256 characters max)