0

what is the different about pretest loop and the postest loop.

29th Sep 2016, 1:21 AM
Nhyn Ojastro
Nhyn Ojastro - avatar
4 Answers
+ 1
A pretest loop will check the condition first and a posttest loop will check the condition after running through the loop body once. Because of this, a pretest loop may not run at all but a posttest loop is guaranteed to run at least one time.
29th Sep 2016, 1:42 AM
Ryne
Ryne - avatar
0
do you mean whats the difference between ++i and i++?
29th Sep 2016, 1:35 AM
Mythos
0
yes sir
29th Sep 2016, 1:37 AM
Nhyn Ojastro
Nhyn Ojastro - avatar
0
for post test, the value of i gets incremented after the loop runs through and for pretest the value gets incremented before the loop runs through
29th Sep 2016, 1:49 AM
Mythos