Posts

Showing posts with the label Difference Between Break and Continue

Difference Between break and continue Statement in C++ - Explained with Examples

In C++, break and continue are jump statements used to control the execution of loops. Although both change the normal flow of execution, they work differently. C++ में break और continue दोनों Jump Statements हैं, जिनका उपयोग loops के execution को control करने के लिए किया जाता है। हालाँकि दोनों program के सामान्य flow को बदलते हैं, लेकिन इनका कार्य अलग-अलग होता है। The break statement terminates the nearest enclosing loop immediately. break statement nearest enclosing loop को तुरंत terminate करता है। The continue statement skips the remaining statements of the current iteration and moves to the next iteration. continue statement current iteration के शेष statements को skip करके अगली iteration पर चला जाता है। 1. break Statement in C++ The break statement is used to terminate a loop immediately when a specified condition becomes true. Control then moves to the first statement after the loop. जब कोई specified condition true होती है, तब break statement loop को तुरंत terminate कर द...