Skip to content
Related Articles

Related Articles

break command in Linux with examples
  • Last Updated : 15 May, 2019
GeeksforGeeks - Summer Carnival Banner

break command is used to terminate the execution of for loop, while loop and until loop. It can also take one parameter i.e.[N]. Here n is the number of nested loops to break. The default number is 1.


break [n]

Example 1: Using break statement in for loop

Example 2: Using break statement in while loop

Example 3: Using break statement in until loop

break –help : It displays help information.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :