In C language:
2018
In C language:
- A.
Parameters are always passed by value
- B.
Parameters are always passed by reference
- C.
Non-pointer variables are passed by value and pointers are passed by reference
- D.
Parameters are always passed by value-result
Attempted by 771 students.
Show answer & explanation
Correct answer: A
C follows the call by value mechanism.
For pointer parameters, the address is copied and passed by value.
So changes through the pointer can modify the original data, but the pointer variable itself is still passed by value.
Hence, the statement “parameters are always passed by value” is correct.