The following function should swap the values contained in two integer variat
num1 and num2. What, if anything, is wrong with this function?
void swap(int num1, int num2)
{
int temp = num2;
num2 = num1;
num1 = temp;
}
A) You must first initialize temp to 0 before using it.
B) The variable temp should first be set to num1, not num2.
C) The swap function must use reference parameters.
D) The last line should be temp = num1.
E) Nothing is wrong with this function.