Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
It is used to check multiple conditions.
It can be used as a replacement for the switch statement.
It can be nested within other conditional statements.
All of the above.
To check multiple conditions.
To return a value based on a condition.
To execute a block of code if a condition is true.
None of the above.
unless (condition) { }
if (condition) { } else { }
unless { } else { }
unless (condition) { } else { }
switch (expression) { case value: statements; break; default: statements; }
switch (expression) { case value: statements; break; default: }
switch (expression) { case value: statements; default: statements; }
switch (expression) { case value: statements; default: }
if (condition) { }
To execute a block of code if the "if" condition is true.
To execute a block of code if the "if" condition is false.
if
else
switch
none of the above
if (condition) { } else if (condition) { } else { }
if (condition) { } else { } if (condition) { }
if (condition) { } if (condition) { } else { }
if { } else if { } else { }
when (expression) { case value -> statements }