🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: C Functions and Recursion: all 10 questions

Quiz: C Functions and Recursion · Question 9 of 10

C passes arguments by value. How can a function change a variable that belongs to its caller?

C passes arguments by value. How can a function change a variable that belongs to its caller?

  1. A.Declare the parameter as static
  2. B.Return the variable twice
  3. C.Pass the variable's address and change it through a pointer
  4. D.It is impossible in C
Answer & explanation

Correct answer: Pass the variable's address and change it through a pointer

With the address, the function reaches the caller's variable itself instead of a copy.

Can you get the rest right without peeking?

Take the timed Quiz: C Functions and Recursion quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →