Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Explain break statement in Ruby?



Explain break statement in Ruby?..

Answer / Gaurav Khare

The break statement in Ruby is used to exit a loop (such as while, until, or for) immediately. When the break statement is encountered within a loop, the loop terminates and execution continues with the next statement outside of the loop.n```rubynfor i in 1..5n if i == 3n break # exits the loop heren endnnputs i # this line will not be executed for i=3 because we broke out of the loop

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

Explain the difference between nil and false in ruby?

1 Answers  


Explain the types of variables available in ruby class?

1 Answers  


Explain some of the looping structures available in ruby?

1 Answers  


Tell me can you call a private method outside a ruby class using its object?

1 Answers  


Is ruby a dying language?

1 Answers  


Explain retry statement in ruby.

1 Answers  


Please explain the three levels of access control for ruby methods?

1 Answers  


What are the different environment variables present in the ruby?

1 Answers  


What is retry statement in ruby?

1 Answers  


What are the key features of ruby?

1 Answers  


What are the different uses of ruby modules?

1 Answers  


Explain about portability?

1 Answers  


Categories