I have a code problem.

Why do I get 2nd and 4th output ?
It is broken, it should only output 4th output!
(It is a small part from a game I want to make! (I am bigginer) and this is just blowing my mind...

sx=1 but snumber is not = with 1 It should pass ! It is ilogical!
1
2
3
4
5
6
7
8
9
10
11
                sx==2;
                snumber==2;
                cout<<sx<<"     "<<snumber<<endl;
                if(sx==1 && snumber==1)
                    cout<<"first output"<<endl;
                if(sx==1 && snumber!=1);
                    cout<<"2nd output"<<endl;
                if(sx!=1 && snumber==1)
                    cout<<"3rd output"<<endl;
                if(sx!=1 && snumber!=1)
                    cout<<"4th output"<<endl;.
closed account (LA48b7Xj)
You have a semi-colon at the end of line 6, it shouldn't be there.
Haha, thx man!
Topic archived. No new replies allowed.