write a java program to check whether the no. is even or odd
Answers
Answered by
6
import java.util.Scanner;
class CheckEvenOdd
{
public static void main(String args[])
{
int num;
System.out.println("Enter an Integer number:");
Scanner input = new Scanner(System.in);
num = input.nextInt();
if ( num % 2 == 0 )
System.out.println("Entered number is even");
else
System.out.println("Entered number is odd");
}
}
pragyapathak12:
thx
Answered by
2
class san
{
void main(int n)
{
if (n%2==0)
System.out.println("Even number");
else
System.out.println("Odd number")
}
}
Similar questions