Multiple Choice
Assume you have two integer variables, num1 and num2. Which of the following is the correct way to swap the values in these two variables?
A) int temp = num1;
Num2 = num1;
Num1 = num2;
B) int temp = num2;
Num2 = num1;
Num1 = temp;
C) num1 = num2;
Num2 = num1;
D) int temp = num1;
Num2 = temp;
Temp = num2;
Num1 = temp;
E) None of these
Correct Answer:

Verified
Correct Answer:
Verified
Related Questions
Q4: The number of comparisons made by a
Q5: On average, an item is just as
Q6: The _ sort usually performs fewer exchanges
Q7: A _ algorithm is a method of
Q8: The advantage of a linear search is
Q10: When an array is sorted from highest
Q11: Before you can perform a bubble sort,
Q12: A(n) _ search uses a loop to
Q13: A _ search is more efficient than
Q14: The following function should swap the values