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;
Source by www.codegrepper.com #
 
PREVIOUS NEXT
Tagged: #check #number #odd
ADD COMMENT
Topic
Name
8+3 =