Is a for loop a post-test loop?

1 answer

Answer

1153192

2026-08-06 08:45

+ Follow

Yes. The second clause (the condition) is evaluated before each iteration through a loop. It is possible that a for loop will not execute if its precondition is not met. For example, "for( int x = 5; x < 5; x++ )" will not iterate even once.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.