+ 1

what is the difference between return and break?

7th Oct 2016, 5:37 PM
vaishali chauhan
vaishali chauhan - avatar
2 Answers
+ 4
The break statement causes control to pass to the statement following the innermost enclosing while, do, for, or switch statement. Return exits immediately from the currently executing function to the calling routine, optionally returning a value.
7th Oct 2016, 6:04 PM
Sattar Hashemi khosroshahi
Sattar Hashemi khosroshahi - avatar
0
Return means your coming back. Break means something is broken or lunch break. Example-> I'm going on Break and I will Return in a hour. Wow just surprised you didn't know that.
4th Nov 2016, 12:48 AM
Erick Hayes
Erick Hayes - avatar