Discussion
In the loop construct for(exp1; exp2; exp3), which part is always executed exactly once?
Answer: A
Correct answer: exp1
exp1, the initialisation, is evaluated once before the loop starts and never again. exp2, the condition, is evaluated before every pass - at least once, and once more than the body runs. exp3, the update, runs after each pass, so it may not run at all if the condition fails immediately.
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