Home » C++ Programming » References » Question
  1. What is the output of this program?
    #include <iostream>
    using namespace std;
    int main()
    {
    int num1, num2;
    int* Res;
    Res = &num1;
    num1 = 150;
    num2 = 100;
    *Res = 150;
    num2 = *Res;
    cout << *Res << " " << num2;
    return 0;
    }
    1. 200 200
    2. 100 100
    3. 150 150
    4. Compilation Error
    5. None of these
Correct Option: C

In this program, We are making the assignments and invoking the both num1 and num2 values as 150 by dereference operator.



Your comments will be displayed only after manual approval.