Ls 7 - Conditional and Looping Statements - Worksheet 1
Ls 7 - Conditional and Looping Statements - Worksheet 1
Worksheet 1
Question 1
Choose the correct answer and write the correct option:
1) Which of these selection statements test only for equality?
a) if
b) switch
c) if & switch
d) none of the mentioned
a) java.io
b) java.lang
c)java.util
d) java.sys
a) 0.0
b) 1.0
c)2.0
d) -1.0
a)12345678910
b) 11
c)Error
d) 1 2 3 4 5 6 7 8 9 10
int counter=1;
do
{
System.out.println(counter);
}
while(counter++ < 5);
a)3
b) 4
c)5
d) 6