Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
double arr[] = {5.0, 6.0, 7.0, 8.0};
6.
double *p = (arr+2);
7.
cout
Options:
A .  rvalue equivalent to the value at the pointer address.
B .  lvalue equivalent to the value at the pointer address.
C .  it will return nothing
D .  none of the mentioned
Answer: Option B

Answer:(a)
Explanation:
In this program, We are printing the values that are pointed by pointer and also the dereference oerator.
Output:
$ g++ def5.cpp
$ a.out
7
0xbf99fc98
8
5
14



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers