Answers for "odd and even"

0

odd and even

Numbers -- odd & even
Write a method which can identifies given number is even or odd 
EX: 
identify(5) ->  "Odd"   
identify(6) ->  "Even"
 
Solution :
public  static  String  identifyOddEven( int  n ) {
return  n%2==0 ? "Even" : "odd" ; 
}
Posted by: Guest on September-29-2021

Browse Popular Code Answers by Language