🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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 &?

  1. A.It makes n an integer
  2. B.scanf needs the address where it should store the value
  3. C.It prints n
  4. 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 →