WorksheetsJava Quiz 1
Total questions: 5
Worksheet time: 5mins
Name
Class
Date
1.
Find the output of the following program?
a)
j = 4
b)
j = 6
c)
j = 2
d)
j = 0
2.
Find the output of the following program?
a)
i = 6 and j = 5
b)
i = 5 and j = 5
c)
i = 6 and j = 4
d)
i = 5 and j = 6
3.
Predict the output of the following program?
a)
0 2 4
b)
0 2 4 5
c)
0 1 2 3 4
d)
Compilation Fails
4.
Choose the correct statement?
a)
If a is true and b is true then the output is "A && B"
b)
If a is true and b is false then the output is "notB"
c)
If a is false and b is true then the output is "ELSE"
d)
If a is false and b is false then the output is "ELSE"
5.
Which statement is true?
a)
"odd" will always be output.
b)
"even" will always be output.
c)
Compilation fails.
d)
"odd" will be output for odd values of x, and "even" for even values.
100 %
