Solved

Assume You Have Two Integer Variables, Num1 and Num2

Question 9

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions