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, b = 10, c = 15;
6.
int arr[3] = {&a, &b, &c};
7.
cout
Options:
A .  15
B .  18
C .  garbage value
D .  compile time error
Answer: Option D

The conversion is invalid in this array. So it will arise error. The following compilation error 

will be raised:
cannot convert from 'int *' to 'int'




Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers