X617: Scope Exercise 6

What is the scope of the variable spicy?

int peper = 7;
int cumin = 17;
if ((pepper>5) && (cumin < 20)) {
    int spicy = 10;
    System.out. println(“Spice level: “ + spicy);
} else {
    System.out.println(“Not spicy”);
}

Your Answer:

Select one answer:


Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.