Home » C++ Programming » Pointers » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    int p = 10, add;
    void *ptr = &p;
    double q = 2.24;
    ptr = &q;
    add = p + q;
    cout << add << '\n' << ptr;
    return 0;
    }
    1. 2.24
    2. 10
    3. 2.24
      10
    4. 0x7115378f4d48
      12
    5. 12
      0x7115378f4d48
Correct Option: E

In this program, we are just adding the two values and printing it.



Your comments will be displayed only after manual approval.