Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int a = 5, c;
6.
void *p = &a;
7.
double b = 3.14;
8.
p = &b;
9.
c = a + b;
10.
cout
Options:
A .  8, memory address
B .  8.14
C .  memory address
D .  none of the mentioned
Answer: Option A

In this program, we are just adding the two values and printing it.
Output:
$ g++ poi.cpp
$ a.out
8
0xbfef0378



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers