Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int a, b;
6.
int* c;
7.
c = &a;
8.
a = 200;
9.
b = 200;
10.
*c = 100;
11.
b = *c;
12.
cout
Options:
A .  100 200
B .  100 0
C .  200 200
D .  100 100
Answer: Option D

In this program, We are making the assignments and invoking the both b and c values as 100 

by dereference operator.
Output:
$ g++ def.cpp
$ a.out
100 100



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers