Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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" ; 
}
Source by javahungry.blogspot.com #
 
PREVIOUS NEXT
Tagged: #odd
ADD COMMENT
Topic
Name
3+5 =