← BYTES
C·Starter·Ref: 7.1.11

What is the key structural difference between a for loop and a while loop in C?

Have a question about this video? Mention reference 7.1.11 when you contact us.

a.They cannot both be used for the same task
b.for loops can only count upward
c.while loops cannot contain a counter variable
d.A for loop conventionally bundles initialization, condition, and increment in one line; a while loop only has a condition, with init/increment handled separately
Both are general-purpose loops that can express the same logic, but `for (init; cond; incr)` groups the three loop-control pieces together syntactically, which is why for loops are the conventional choice when the number of iterations is known in advance.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES7111#C