Consider the following C function C void swap (int a, int b) { int temp; temp…
Consider the following C function
C
void swap (int a, int b)
{
int temp;
temp = a;
a = b;
b = temp;
}
In order to exchange the values of two variables x and y.
- A.
Call swap (x, y)
- B.
Call swap (&x, &y)
- C.
swap(x,y) cannot be used as it does not return any value
- D.
swap(x,y) cannot be used as the parameters are passed by value
Attempted by 1075 students.
Sign up free to check your answer
Sign up freeLoading lesson…