//Check no is even or odd
import java.util.Scanner;
class Even_Odd {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter a no:");
int n=sc.nextInt();
if(n%2==0)
System.out.println("Even no");
else
System.out.println("Odd no");
}
}
import java.util.Scanner;
class Even_Odd {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter a no:");
int n=sc.nextInt();
if(n%2==0)
System.out.println("Even no");
else
System.out.println("Odd no");
}
}
No comments:
Post a Comment