accept a number and display if the number is even or odd
Answers
Answered by
0
Answer:
NUMBER :- 12
TYPE :- EVEN
PLS MARK ME THE BRAINLIEST :)
Answered by
0
Java code:
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
If(n%2 == 0)
{
System.out.println(“even number”);
}
else
{
System.out.println(“odd number”);
}
}
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
If(n%2 == 0)
{
System.out.println(“even number”);
}
else
{
System.out.println(“odd number”);
}
}
Similar questions