Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 4: Iteration
Start Practice TestPractice Test
About Exam
medium Solved by 3 students

Java Nested Conditional Logic

Mark
< Prev
Next >

Consider the following code segment. Which of the following strings could NOT be printed when the code is executed?

int num = /* some integer value */;
if (num > 0) {
    if (num % 2 == 0) {
        System.out.print("Even");
        if (num > 10) {
            System.out.print(" Large");
        }
    } else {
        System.out.print("Odd");
        if (num < 10) {
            System.out.print(" Small");
        }
    }
} else {
    System.out.print("Zero or Negative");
}
A

Zero or Negative

B

Even Small

C

Even Large

D

Odd Small

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1diceans22 0m 00s 200
#2hitrishabhatia13 0m 00s 80
#3busemagngr11 0m 46s 54
Items per page:
10
1 – 3 of 3

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|