Two layers of if else statement not working !

When I input 11 and 12 ,it always prompts equal!!!!
What's wrong with my code ?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <string>

// say what standard-library names we use
using std::cin;         using std::endl;
using std::cout;        using std::string;

int main()
{
    int first , second ;
    cin >> first ;
    cin >> second ;
    if(first >> second)
        cout << "first is bigger!";
     else
     {
        if(second >> first)
        cout  << "second is bigger!";
        else
        cout << "equal!!!!!";
    }
}

Hi,

Can you tell us in your words what the >> on lines 13 and 17 does, in your own words?
OMG ...Thank you ,
I made this mistake and didn't notice that for 1 hour !How stupid I was ....
I changed the >> on lines 13 and 17 .to >
now it works perfectly!
Should I delete this post now ?
Hi,

No, don't do that - it might be helpful to someone else :+)

Am pleased you have fixed your problem.

Regards
Topic archived. No new replies allowed.