📜  奇偶 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:38.704000             🧑  作者: Mango

代码示例1
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" ; 
}