Home » C++ Programming » Comments » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    void square (int *p)
    {
    *p = (*p + 3) * (*p);
    }
    int main ( )
    {
    int n = 15;
    square(&n);
    cout << n;
    return 0;
    }
    1. 207
    2. 270
    3. 15
    4. 3
    5. None of these
Correct Option: B

We have increased the x value in operand as p + 1, so it will return as 270.



Your comments will be displayed only after manual approval.