C++ goto Statement
C++ goto Statement
In C++ programming, goto statement is user for altering the normal sequence of program execution by transferring control to some other part of the program,
Syntax of goto Statement
Example : goto Statement
Output
You can write any C++ program without the use of goto statement and is generally considered a good idea not to use them.
Reason to Avoid goto Statement
The goto statement gives power to jump to any part of program but, mmakes the logic of the program complex and tangled.
In modern programming, goto statement is considered a harmful construct and a bed programming practice.
The goto statement can be replaced in most of C++ program with the use of break ststement and continue ststement.
0 comments:
Post a Comment