MCQ Practice Single Best Answer Topic: Function in C Language

Q What is the difference between call by value and call by reference in C language?

Question ID
#7186
Subchapter
Function in C Language
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A Call by value passes the address of the argument to the function, while call by reference passes a copy of the argument value.
  • B Call by value passes a copy of the argument value to the function, while call by reference passes a reference to the argument variable.
  • C Call by value and call by reference are the same thing.
  • D Call by value passes a reference to the argument variable, while call by reference passes a copy of the argument value.
Correct Answer: B

Explanation

Answer: b. Call by value passes a copy of the argument value to the function, while call by reference passes a reference to the argument variable.

Explanation: In call by value, a copy of the argument value is passed to the function, while in call by reference, a reference to the argument variable is passed to the function. Call by reference allows the function to modify the argument variable, while call by value does not.

Share This Question

Share this MCQ with your friends or study group.