← Quiz: C Data Types and Operators: all 10 questions
Quiz: C Data Types and Operators · Question 2 of 10
Why does scanf("%d", &n); use &?
Why does scanf("%d", &n); use &?
- A.It makes n an integer
- B.scanf needs the address where it should store the value
- C.It prints n
- D.It's optional
Answer & explanation
Correct answer: scanf needs the address where it should store the value
& gives the address of n so scanf can write into it.
Can you get the rest right without peeking?
Take the timed Quiz: C Data Types and Operators quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →