Bird
0
0

What does the scanf function return in C?

easy📝 Conceptual Q1 of 15
C - Input and Output
What does the scanf function return in C?
AThe value read from the input
BThe address of the variable
CThe number of input items successfully matched and assigned
DThe size of the input buffer
Step-by-Step Solution
Solution:
  1. Step 1: Understand scanf return value

    The scanf function returns how many input items it successfully reads and assigns.
  2. Step 2: Differentiate from other values

    It does not return the input value itself or addresses, but the count of successful assignments.
  3. Final Answer:

    The number of input items successfully matched and assigned -> Option C
  4. Quick Check:

    scanf return = number of items assigned [OK]
Quick Trick: scanf returns count of successful inputs assigned [OK]
Common Mistakes:
  • Thinking scanf returns the input value
  • Confusing return with variable address
  • Assuming it returns buffer size

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes