Bird
0
0

Why does a loop sometimes cause a program to freeze or crash?

hard📝 Conceptual Q10 of 15
C - Loops
Why does a loop sometimes cause a program to freeze or crash?
ABecause loops cannot access variables
BBecause the loop condition never becomes false, causing an infinite loop
CBecause loops always run only once
DBecause loops are only for printing text
Step-by-Step Solution
Solution:
  1. Step 1: Understand infinite loops

    If the loop condition never becomes false, the loop runs forever.
  2. Step 2: Recognize effect on program

    Infinite loops cause the program to freeze or crash due to endless execution.
  3. Final Answer:

    Because the loop condition never becomes false, causing an infinite loop -> Option B
  4. Quick Check:

    Infinite loop = condition never false [OK]
Quick Trick: Always ensure loop condition can become false [OK]
Common Mistakes:
  • Thinking loops run once
  • Believing loops can't use variables
  • Assuming loops only print text

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes