Examveda

What will be the output of the following C++ code?
#include <stdio.h>
#include<iostream>
using namespace std;
int main()
{
    int a = 5, b = 10, c = 15;
    int arr[3] = {&a, &b, &c};
    cout << *arr[*arr[1] - 8];
    return 0;
}

A. 15

B. 18

C. garbage value

D. compile time error

Answer: Option D


Join The Discussion

Related Questions on Arrays and Strings in C plus plus