Pointer in C++ MCQs Exercise II

Ques 1 Pointer


Which of the following is the correct way for accessing the first elements of the array if "p" is the array pointer variable?

A p[0]
B p
C *p
D both a and c

Ques 2 Pointer


What will be the output of the following C++ Code?


#include<iostream>
using namespace std;
int main()
{
      int arr[]={50,60,75,80,90,126};
      int *p=(arr+3);
      cout<<*p+*(p+1);
}

A 161
B 170
C 135
D 151

Ques 3 Pointer


What will be the output of the following C++ Code?


#include<iostream>
using namespace std;
int main()
{
      int a=89,b=56,c=45;
      int *arr[]={&a,&b,&c};
      cout<<(arr+2);
}

A 45
B 56
C Address of c
D None of these