Bird
0
0

Why is it important to use the address-of operator (&) with variables in scanf?

hard📝 Conceptual Q10 of 15
C - Input and Output
Why is it important to use the address-of operator (&) with variables in scanf?
ABecause & converts variable to string
BBecause scanf needs the memory location to store input
CBecause & prints the variable value
DBecause & is optional and used for style
Step-by-Step Solution
Solution:
  1. Step 1: Understand how scanf stores input

    scanf stores input directly into the variable's memory location.
  2. Step 2: Role of & operator

    The & operator gives the memory address of the variable so scanf can write the input there.
  3. Final Answer:

    Because scanf needs the memory location to store input -> Option B
  4. Quick Check:

    Use & to give scanf variable address [OK]
Quick Trick: Use & to give scanf variable's memory address [OK]
Common Mistakes:
  • Thinking & converts variable to string
  • Assuming & prints value
  • Believing & is optional

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes