cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Help me translate this very simple if fu
Help me translate this very simple if function to C++
Oct 16, 2014 at 9:57pm UTC
Slashdash
(49)
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)
Oct 16, 2014 at 10:00pm UTC
Esslercuffi
(305)
you're close
if ( x != y && z > 1 )
Oct 16, 2014 at 10:00pm UTC
TheKingOfTyrants
(232)
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.