Please enable JavaScript.
Coggle requires JavaScript to display documents.
Looping Statement, Allowing us to repeat certain part of the program until…
Looping Statement
-
The working of BREAK
-
The break statement can be used in terminating all 3 loops which is For,While and Do While
Goto statement
Also can create a loop by jumping backwards to a label through this is generally discouraged as a bad programming practice
Is used for altering the normal sequence of program execution by transferring control to some part of the program
Reason to avoid goto statement by using goto statement give power to jump to any part of program and using goto statement makes the logic of the program complex and tangled
-
Break statement
Allows you to exit a loop from any point within its body by passing its normal termination expression
Break also used in conjunction with function and case statement which have been covered in previous session
Meaning
Looping statement is a sequence of instruction that is continually repeated until a certain condition is reached
-
Allowing us to repeat certain part of the program until a specified number of repetitions and allow to determine the required number of repetitions