Discussion
The following code ‘for(;;)’ represents an infinite loop. Which statement exits the loop itself?
Answer: A
Correct answer: break
break is the statement that ends the loop: control passes to the statement after it and the program carries on. exit(0) and abort() would also stop the loop running, but only by ending the whole program, which is a different thing from leaving the loop.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development