'if 'and 'else' HELP

im learning C++ and in the book im learning from says to type this code in but when i do i get (error: no match for 'operator>' in std::cin > i;) im using code::block

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
using namespace std;
int main()
{
    int i;
    cin > i;
    if (i > 10) {
        cout << "its greater than 10" << endl;
    }
    else {
        cout << "its not greater than 10" << endl;
    }
    return 0;
}

Last edited on
Fix line 6 to this:

cin >> i;
Last edited on
it worked! thank you Hadar
Topic archived. No new replies allowed.