-
What is the output of this program?
#include <iostream>
using namespace std;
int main ()
{
int num1, num2;
num1 = 6;
num2 = 5;
num1 = num2;
num2 = 3;
cout << "num1:";
cout << num1;
cout << ", num2:";
cout << num2;
return 0;
}
-
- num1: 5, num2: 3
- num1: 3, num2: 5
- num1: 6, num2: 5
- Compilation Error
- None of these
Correct Option: A
In this program, we are reassigning the values of num1 and num2 because of this we got the output as num1:5 num2:3