1.

Can the break statement be used to abort a program?(a) Yes(b) Yes, but only if it is used within the global scope(c) No(d) Yes, but only for some Arduino BoardsI got this question in a national level competition.My enquiry is from Control Structures in division Arduino Programming of Arduino

Answer»

The correct OPTION is (c) No

To explain I would SAY: The break statement is almost never used for aborting the execution of a program. It was designed for EXITING looping structures and shifting the CONTROL to the next scope available. The control statement that helps with that is the exit function.



Discussion

No Comment Found

Related InterviewSolutions