Explanation: Foreach loop is not there in ruby.
Dear candidates you will find MCQ questions of Ruby here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
Explanation: Foreach loop is not there in ruby.
Explanation: Executes code while conditional is false. An until statement`s conditional is separated from code by the reserved word do, a newline, or a semicolon.
Explanation: Executes code while conditional is true. A while loop`s conditional is separated from code by the reserved word do, a newline, backslash , or a semicolon.
Explanation: Terminates the most internal loop. Terminates a method with an associated block if called within the block (with the method returning nil).
Explanation: Next : Jumps to the next iteration of the most internal loop. Terminates execution of a block if called within a block
Explanation: Redo : Restarts this iteration of the most internal loop, without checking loop condition. Restarts yield or call if called within a block.
Explanation: If retry appears in the iterator, the block, or the body of the for expression, restarts the invocation of the iterator call. Arguments to the iterator is re-evaluated.
Explanation: 1..5 means start from one and go till 4 and even include 5.
Explanation: end: This keyword represents the ending of 'for' loop block which started from 'do' keyword.
Explanation: do..while is Exit-Controlled loop because it tests the condition which presents at the end of the loop body.