What is the main difference between For and While loops in Java, C or C++

Showing Answers 1 - 2 of 2 Answers

senthil kumar

  • Jun 22nd, 2006
 

In C for FOR loop there will not be a termination symbol,whereas while loop we have termination symbol.In FOR loop we have initialization;conditon;incrementationare declared inside the brackets.In WHILE block if the condition in the loop is true then output will be executed.

  Was this answer useful?  Yes

rabbi

  • Jul 3rd, 2006
 

while loop is a control flow statement that allows code to be executed repeatedly based on a given boolean condition.
And

for loop is a control flow statement which allows code to be executed iteratively.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions