-
What is the output of this program?
#include <iostream>
using namespace std;
int main()
{
double array[] = {3.0, 5.0, 6.0, 4.0};
double *p = (array + 3);
cout << *p << endl;
cout << array << endl;
cout << *(array + 2) << endl;
cout << *(array) << endl;
cout << *array + 6 << endl;
return 0;
}
-
- 4
0x7ffd1eb06bc0
6
3
9 - 4
6
3
9
0x7ffd1eb06bc0 - 6
3
9
0x7ffd1eb06bc0 - 3
9
0x7ffd1eb06bc0
6
4 - None of these
- 4
Correct Option: A
In this program, We are printing the values that are pointed by pointer and also the dereference operator.