Loops let you repeat actions until a condition is met or iterate over a range of values.
for
LoopThe for
loop is used when the number of iterations is known.
while
LoopExecutes a block of code as long as the specified condition is true.
do-while
LoopThe do-while
loop runs the code block at least once, then checks the condition.