Multiple Choice
Consider the following two Java code segments:
Segment 1 Segment 2
Int i = 0;
For (int i = 0; i <= 20; i++) {
While (i < 20) { System.out.println(i) ;
I++; }
System.out.println(i) ;
}
Which of the following statements are true?
A) The output from these segments is not the same.
B) The scope of the control variable i is different for the two segments.
C) Both (a) and (b) are true.
D) Neither (a) nor (b) is true.
Correct Answer:

Verified
Correct Answer:
Verified
Q1: Which of the following will not help
Q2: Consider the classes below:<br> public class TestA
Q4: For the code segment below:<br> switch(q) {<br>Case
Q5: Suppose variable gender contains MALE and age
Q6: Which statement prints the floating-point value 123.456
Q7: Which of the following statements about a
Q8: Which of the following can be used
Q9: Consider the code segment below.<br> if (gender
Q10: Which of the following for-loop headers results
Q11: Which case of the following would warrant