Write an expression that evaluates to true if the integer variable x contains an even value , and false if it contains an odd value .

2
Write an expression  that evaluates  to true  if the integer  variable  x contains an even value , and false  if it contains an odd value .

LANGUAGE: C++

CHALLENGE:

Write an expression  that evaluates  to true  if the integer  variable  x contains an even value , and false  if it contains an odd value.

SOLUTION:


(x % 2 == 0)

2 comments

Add comment