1.

Which one of the control structures is similar to the if-else statement?(a) Switch-case(b) For loop(c) While loop(d) ContinueThe question was posed to me in an interview.My doubt is from Control Structures topic in chapter Arduino Programming of Arduino

Answer»

Right answer is (a) Switch-case

For explanation: The switch case is ANOTHER TYPE of decision-making control structure which can be used as a total REPLACEMENT for the if-else structure. However, since it’s a more RIGID structure, it’s mostly used for menu driven programs.



Discussion

No Comment Found

Related InterviewSolutions