Ruby | Control Flow AlterationPrerequisite : Decision Making , Loops Ruby programming language provides some statements in addition to loops, conditionals, and iterators, which are used to change the flow of control in a program. In other words, these statements are a piece of code that executes one after another until the condi
7 min read
Ruby Break and Next StatementIn Ruby, we use a break statement to break the execution of the loop in the program. It is mostly used in while loop, where value is printed till the condition, is true, then break statement terminates the loop. Syntax : Break Example : Ruby # Ruby program to use break statement #!/usr/bin/ruby -w i
2 min read