πΈLoops
there are 3 types of loops in c:
for
while
do while
while loop
while (condition){ do this }
also has break and continue operands
while true loop ( infinite while loop)
while(1){ ... }
do-while loop
is a loop where the body is executed for the first time unconditionally. always guaranteed to execute at least once.
do { statement } while (expression);
example:
for loop
for ( statement ; condition; action){ do this until reaching the condition }
example:
infinite for loop
ββfor(;;) { / statements / }
nested loop (for loop example)
example:
Last updated