Pointer in C++ MCQs Exercise I
Ques 1
Pointer
Which of the following is true about Pointer?
A Pointer is variable that hold the address of another variable.
B Pointer is a type of variable that hold only primitive Datatypes.
C We cannot define function as a pointer.
D All of these
Ques 2
Pointer
Which of the following correct ways to declare a pointer variable?
A char p;
B char *p;
C Pointer p;
D char &p;
Ques 3
Pointer
Choose the correct option for Pointer declaration.
int *x,y;
A x and y are pointer to integer.
B x is pointer to integer and y is a intger.
C x is integer and p is pointer to integer.
D x and y are integer
Ques 4
Pointer
What is the default initial value of C++ Pointer ?
Ques 5
Pointer
What is the output of the following C++ Code?
#include<iostream>
using namespace std;
int main()
{
int *p;
int q;
p=&q;
q=100;
cout<<*p;
}
A Garbage Value
B 0
C 100
D Address of pointer p
Ques 6
Pointer
What is the output of the following C++ Code?
#include<iostream>
using namespace std;
int main()
{
int *p;
int q;
p=&q;
q=100;
cout<<p;
}
A Garbage Value
B 0
C 100
D Address of pointer p