- AInfinite times
- B11 times
- C0 times
- D10 times
Time Taken:
Correct Answer:
Wrong Answer:
Percentage: %
Option B
The while(j <= 255) loop will get executed 255 times. The size short int(2 byte wide) does not affect the while() loop.
Answer: b) break
Explanation: The break statement is used to terminate a loop completely.
Answer: c) exit
Explanation: The exit statement is used to exit from a function or program.
Answer: d) return
Explanation: The return statement is used to return a value from a function.
Answer: a) continue
Explanation: The continue statement is used to skip the current iteration of a loop and continue with the next iteration.
The for loop is ideal for situations where the number of iterations is predetermined and specified in the loop header.
The while loop repeatedly executes a block of code as long as the specified condition remains true.
The "break" statement is used to exit the loop immediately, even if the loop condition is still true.
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.