Computer Science - Object Oriented Programming Using C++ - Discussion
Discussion Forum : Object Oriented Programming Using C++ - Section 2 (Q.No. 14)
14.
In which statements, does a 'continue' statements cause the control to go directly to the test condition and then continue the looping process?
Discussion:
7 comments Page 1 of 1.
Himanshu said:
1 decade ago
Whats wrong with 'for-loop'. Give a example please.
Sundar said:
1 decade ago
In for-loop:
continue; --> The control will be transfered to increment section, then condition checking.
But the question is "...control to go directly to the test condition..."
So, while-loop and do-while-loop is the correct one.
I hope this will help you. Have a nice day!
continue; --> The control will be transfered to increment section, then condition checking.
But the question is "...control to go directly to the test condition..."
So, while-loop and do-while-loop is the correct one.
I hope this will help you. Have a nice day!
Vasudevan said:
1 decade ago
Is this correct? I think we can use continue statement in for loop also.
(1)
Suresh said:
1 decade ago
Sundar is correct.
We can use the continue statement in for-loops, nut it will transfer the control to increment section then condition checking not directly to condition checking.
Since the question is "...directly to the test condition...", the given answer is correct.
We can use the continue statement in for-loops, nut it will transfer the control to increment section then condition checking not directly to condition checking.
Since the question is "...directly to the test condition...", the given answer is correct.
Prince said:
1 decade ago
Thank you sundar you explained well.
Rex said:
6 years ago
I think the answer is B. In do-While first do the procedure and then check.
If I am wrong, correct me.
If I am wrong, correct me.
Saba said:
5 years ago
Continue; --> The control will be transferred to increment section, then condition checking.
But the question is ". Control to go directly to the test condition".
So, while-loop and do-while-loop is the correct one.
A 'continue' statements cause the control to go directly to the test condition and then continue (continue; --> The control will be transferred to increment section, then condition checking. ) the looping process.
But the question is ". Control to go directly to the test condition".
So, while-loop and do-while-loop is the correct one.
A 'continue' statements cause the control to go directly to the test condition and then continue (continue; --> The control will be transferred to increment section, then condition checking. ) the looping process.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers