Interview Question

Post Silicon Validation Engineer Interview Folsom, CA

Difference between while and do-while loops.

Answer

Interview Answer

1 Answer

0

Loop condition is checked before entering the loop in case of "while".If it does not get satisfied, control will never go in the loop.
Loop condition is checked at the end of each iteration through the loop in case of "do while".Even if the condition is invalid from start, control will still make the first iteration through the loop.

Trupti B on Apr 10, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.