write a java statement x[5] is even or odd number
Answers
Answered by
1
Answer:
import java.util.Scanner;
public class EvenOdd {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
System.out.print("Enter a number: ");
int num = reader.nextInt();
if(num % 2 == 0)
System.out.println(num + " is even");
else
System.out.println(num + " is odd");
}
}
Answered by
1
Answer:
if(x[5]%2==0)
System.out.println("even");
else
System.out.println("odd");
Similar questions
India Languages,
3 months ago
Science,
3 months ago
Math,
6 months ago
Biology,
11 months ago
Math,
11 months ago