The java programming language supports the following types of controlling
statements such as:
1.The break statement
2.The continue statement
3.The return statement
Break: The break statement is used in many programming languages such as c, c++, java etc. Some times we need to exit from a loop before the completion of the loop then we use break statement and exit from the loop and loop is terminated. The break statement is used in while loop, do - while loop, for loop and also used in the switch statement.
Code of the program :
Output of the program :
The Prime number in between 1 - 50 :
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: June 6, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles