Write a program to check a number is even or not in java
Write a program to check a number is even or not in java
public class evenOdd{ public static void main(String args[]){ int num=5; if(num%2==0){ System.out.println("Even"); }else{ System.out.println("Odd"); } }}
public class evenOdd
{
public static void main(String args[]){
int num=5;
if(num%2==0){
System.out.println("Even");
}else{
System.out.println("Odd");
}
}
}
Output
Odd
Comments
Post a Comment