MCQ Single Best Answer Easy

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

ID: #7186 Function in C Language 162 views
Question Info
#7186Q ID
EasyDifficulty
Function in C LanguageTopic

Choose the Best Option

Click any option to instantly check if you're 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: Option 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

Challenge a friend or share with your study group.