Computer Science, asked by billiegomez93, 6 months ago

write a java statement x[5] is even or odd number​

Answers

Answered by Sachin24Kumar
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 subgb98
1

Answer:

if(x[5]%2==0)

System.out.println("even");

else

System.out.println("odd");

Similar questions