Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check if a number is even or odd

// @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
3+1 =