Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

check if a number is even or odd C++

// @Author: Subodh 
// 1 liner solution
(num & 1) ? cout << num << " is odd" : cout << num << " is even" << endl;
 
PREVIOUS NEXT
Tagged: #check #number #odd
ADD COMMENT
Topic
Name
7+8 =