Consider the following code segment. Assume num is a properly declared and initialized int variable. if (num > 0) { if (num % 2 == 0) { System.out.println("A"); } else { System.out.println("B"); } } Which of the following best describes the result of executing the code segment? (A) When num is a negative odd integer, "B" is printed; otherwise, "A" is printed. (B) When num is a negative even integer, "B" is printed; otherwise, nothing is printed. (C) When num is a positive even integer, "A" is printed; otherwise, "B" is printed. (D) When num is a positive even integer, "A" is printed; when num is a positive odd integer, "B" is printed; otherwise, nothing is printed. (E) When num is a positive odd integer, "A" is printed; when num is a positive even integer, "B" is printed; otherwise, nothing is printed.



Answer :

Other Questions