Hey guys,
Please help me about understanding of call by parameters.
For this C syntax:
What are the values of variables value and list after each of the three calls to swap with the following parameter-passing methods:Code:void main(){ int value =2, list[5]={1,3,5,7,9}; swap(value, list[0]); swap(list[0], list[1]); swap(value, list[value]); } void swap(int a, int b){ int temp; temp=a; a=b; b=temp; }
a. Passed by value
b. Passed by reference
c. Passed by name
d. Passed by value-result
Any help would be appreciated.