+ 4
Code challenge
check the given number is even or odd without using %, *, / operator....
7 Antworten
+ 17
submit it as an assignment in lesson factory
+ 13
Please submit this as an assignment in the Lesson Factory
https://www.sololearn.com/discuss/1082512/?ref=app
+ 11
print("Odd" if int(input())&1 else "Even")
print(["Even", "Odd"][int(input())&1])
+ 4
ok
+ 4
check in code playground ...already submitted
+ 4
if (num % 2 == 0) cout << "Even";
else cout << "Odd";
//Or
cout << (num % 2 == 0) ? "Even" : "Odd";
//Or
cout << (!(num%2)) ? "Even" : "Odd";
//Or
cout << (num%2) ? "Odd" : "Even";