ProAnswers.org

which loop is better in C and C++, for loop or while loop or do while?

which loop is better in C and C++, for loop or while loop or do while?

if code size is big then for loop gives better understanding of how many time the loop is going to execute.

do while loop is good for optimization. this will avoid one conditional check in the loop.