Help me translate this very simple if function to C++

My function needs to go like this:

if x is not equal to y and z is above(>) 1

I tried to write it but it didn't seem to work in the program, this is what i wrote:

if (x != y & z > 1)
you're close

if ( x != y && z > 1 )
You need to use the logical operator && instead of the bitwise operator & and then you're good to go!
http://www.cplusplus.com/doc/tutorial/operators/
Topic archived. No new replies allowed.