Given below are three implementations of the $\text{swap()}$ function in $\text{C++}$ :
$\begin{array}{|l|l|l|} \hline \qquad \qquad \text{(a)} & \qquad \qquad \text{(b)} & \qquad \qquad \text{(c)} \\ \text{void swap (int a, int b)} & \text{void swap (int &a, int &b)} & \text{void swap (int *a, int *b)} \\ \text{\{} & \text{\{} & \text{\{} \\ \text{int temp;} & \text{int temp;} & \text{int *temp;} \\ \text{temp = a;} & \text{temp = a;} & \text{temp = a;} \\ \text{a = b;} & \text{a = b;} & \text{a = b;} \\ \text{b = temp;} & \text{b = temp;} & \text{b = temp;} \\ \text{\}} & \text{\}} & \text{\}} \\ \text{int main()} & \text{int main()} & \text{int main()} \\ \text{int p = 0,q = 1;} & \text{int p = 0, int q = 1;} & \text{int p = 0 , q = 1;} \\ \text{swap(p,q);} & \text{swap(p,q);} &\text{swap(p,q);} \\ \text{\}} & \text{\}} & \text{\}}\\\hline \end{array}$
Which of these would actually swap the contents of the two integer variables $\text{p}$ and $\text{q}$?
- $\text{(a)}$ only
- $\text{(b)}$ only
- $\text{(c)}$ only
- $\text{(b)}$ and $\text{(c)}$ only