Question
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
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
Answer: Option A
Was this answer helpful ?
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 ?
Submit Solution