I wrote a simple code for finding whether a number is even or odd. Here is the code :
import java.util.*;
public class EvenOdd {
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.println("Enter a number");
int num = in.nextInt();
if (num % 2 == 0)
System.out.println(num+" is even");
System.out.println(num+" is odd");
}
}
Output:- I am getting the output but there is an error aswell
Enter a number
2
2 is even
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [util.c:840]