Examveda

What will be the output of the following C++ code?
#include  <iostream>
using namespace std;
int main()
{
    double arr[] = {5.0, 6.0, 7.0, 8.0};
    double *p = (arr+2);
    cout << *p << endl;   
    cout << arr << endl;  
    cout << *(arr+3) << endl;
    cout << *(arr) << endl;  
    cout << *arr+9 << endl;  
    return 0;
}

A. 7
0xbf99fc98
8
5
14

B. 7
8
0xbf99fc98
5
14

C. 0xbf99fc98

D. 14

Answer: Option A


Join The Discussion

Related Questions on Classes and Objects in C plus plus