- AInfinite times
- B11 times
- C0 times
- D10 times
Answer: c) exit
Explanation: The exit statement is used to exit from a function or program.
Answer: a) continue
Explanation: The continue statement is used to skip the current iteration of a loop and continue with the next iteration.
The do-while loop executes the code block at least once before checking the loop condition. It is useful when you need to ensure the code block runs at least once.
The for loop is ideal for situations where the number of iterations is predetermined and specified in the loop header.
While initialization and condition are mandatory in a for loop, the increment or decrement part is optional.
The "break" statement is used to exit the loop immediately, even if the loop condition is still true.
The "do-while" loop ensures that the code block is executed at least once before checking the loop condition for further execution.
The "exit" statement is used to terminate the entire program and return control to the operating system.
Loop reduces the program code.
Using loops in programming helps to reduce redundancy by allowing a set of instructions to be executed repeatedly without having to write the same code multiple times. This makes the code more concise and easier to maintain.