Question 1 of 10
A spark lives in a loop body. Which statement about this code is true?
int t = 1;
while (t < 3)
{
int spark = t;
t++;
}
System.out.print(spark);
- A. The program displays 1
- B. The program displays 2
- C. The program does not compile because spark exists only in the while block
- D. The program displays 3