NEW
Font size
WorksheetsJAVA CONDITIONAL STATEMENTS
Total questions: 10
Worksheet time: 5mins
Which of the following conditional statements is used to specify a block of code to be executed, if the same condition is false?
if
else
else if
switch
The switch expression is evaluated ONCE.
TRUE
FALSE
In a switch statement, if there is no match, the FIRST case code block is executed.
TRUE
FALSE
Given the code, what will be the output if x = 10?
TAMA
MALI
NONE
ERROR
Given the code, what will be the output if patientBmi = 26?
Underweight
Normal
Overweight
Obese
Given the code, what will be the output if patientBmi = 18.49?
Underweight
Normal
Overweight
Obese
Given the code, what will be the output if patientBmi = 30?
Underweight
Normal
Overweight
Obese
Given the code, what will be the output if ans = C;
Correct answer
Wrong answer
Invalid answer
Wrong answer
Invalid answer
Given the code, what will be the output if ans = B;
Correct answer
Wrong answer
Invalid answer
Wrong answer
Invalid answer
Given the code, what will be the output if ans = D;
Correct answer
Wrong answer
Invalid answer
Wrong answer
Invalid answer
