Home » C++ Programming » Pointers » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    int array[] = {40, 15, 60, 17};
    int *ptr = (array + 3);
    cout << *array + 8;
    return 0;
    }
    1. 40
    2. 15
    3. 60
    4. 17
    5. 48
Correct Option: E

In this program, we are adding the value 8 to the initial value of the array, So it’s printing as 48.



Your comments will be displayed only after manual approval.