Q. What is the output of the following C++ code?
Code:
#include <iostream>
using namespace std;
int main()
{
int arr[] = {1, 2, 3, 4, 5};
int *ptr = (arr + 1);
cout << *arr + 2;
return 0;
}
β
Correct Answer: (C)
3