Answer Posted / Mohd Wamick
The case statement in Ruby is similar to the switch statement in other programming languages. It allows you to execute different blocks of code based on the value of an expression. The basic structure is as follows:n```rubyncase expressionnwhen value1n # code block for when the expression matches value1nwhen value2n # code block for when the expression matches value2n...nelse n # code block for all other casesnend``
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers