MCQZ 7,8

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Fauji Foundation Education System Haripur

Test : Computer Grade 12 Total Marks: 30


Multiple choice Questions.
1)The operator used to get value at address stored in a pointer variable is
a)* b)$ c)&& d) | |
2)Computer memory can be directly manipulate by
a)pointer b)functions c)object and classes d)operators
3)C++ pointers are used to access:
a)memory address b)Data c)functions d)all of these
4)For the declaration of variable which symbol is used:
a)asterisk * b)ampersand && c) | | d)$$
5)The data stored in:
A)pointer b)variable c)memory d)none of these
6) Reference operator is used to store:
a)address of variable c)value of variable d)both a and b c)none of these

7) What does the following statement mean?


int (*fp) (char*);
a) pointer to a pointer
b) pointer to an array of chars
c) pointer to function taking a char* argument and returns an int
d) function taking a char* argument and returning a pointer to int

8) Which of the following is illegal?


a) int *ip;
b) string s, *sp = 0;
c) int i; double* dp = &i;
d) int *pi = 0;

9). What is size of generic pointer in C++ (in 32-bit platform)?


a) 2 b) 4 c) 8 d) 0
10)classes are:
A)built in data type b)user define data type c)functions d)none of these
11)the data and functions with in the class called:
a)member of the class b)data member c)attributes d)all of these
12)Class holds its own data member and:
a)variable b)member functions c)specifiers d)attributes
13)An access specifier consist on types:
a)one b)three c)four d)two
14)variable of type class is called:
a)class b)object c)data members d)functions
15) How many specifiers are present in access specifiers in class?
a) 2 b) 1 c)4 d) 3
16) Which of these following members are not accessed by using direct member access
operator?

a)Public b) Private c)Protected d)Both B & C


17) How to access the object in the class?
A. Ternary operator B. Scope resolution operator C. Direct member access operator(.)
D. None of the above
18) Which of the following is not a member of class?
A. Static Function. B. Friend Function C. Constructor Function
D. Virtual Function
19) Constructor is executed when _____.
A)An object goes out of scope. B) A class is declared C) An object is created
D)An object is used
20)The destructor is represented by:
a) (~) b) ~ c)^ d)none of these
21) Which of the following is not a type of Constructor? a) Friend constructor
b) user define constructor c) Default constructor d) constructor overloading
22) What is the other name used for functions inside a class? a) Member variables
b) Member functions c) Class functions d) Class variables
23) Which of the following provides a programmer with the facility of using Base class and derive
class? a) Inheritance b) Polymorphism c) Abstraction
d) Encapsulation
24)To protect the sensitive information is called:
a)data hiding b) Encapsulation c)none of these d)both a & b
25) Which operator is overloaded for a cout object?
a) >> b) << c) < d) >
26)A constructor is called whenever an object is:
a)created b)deleted c)constructed d)both a and b
27)Constructor and Destructor are special type of:
a)data member d)functions c)member functions d)all of these
28)Constructor and destructor should be:
a)Private b)Protected c)Public d)Virtual
29)Which specifier is used by default:
a)Protected b)Private c)public d)none of these
30)Polymorphism refer to:
a)same classes b)one thing with multiple functions d)both a & b

31)In C++ functions are also called ___ ( A ) Definitions (B) Concepts (C) Methods

(D) Organizers

32) OOP stands for ___

(A) Object to Object Programming (B) Object Oriented Programming (C) Online Objects Programming (D)

Object Oriented Processes

33) ) In a class data members are also called as ___ (A) Abstracts (B) Attributes

(C) Properties (D) Dimensions

34)Which of the following is not a valid class specifier?


(A) Private (B) Pointer (C) Public (D) Protected

You might also like