GAT Subject :: All Aptitude Test ::

Hassan
1.When a class serves as a base class to others, _____
A. all of its members are inherited
B. all of its members are inherited, except for any private members
C. all of its members are inherited, except for any protected members
D. all of its members are inherited

2.Storing a class definition in a separate file is an example of
A. polymorphism
B. name mangling
C. implementation hiding
D. polymorphism

3.Which is true?
A. Sequential cohesion is slightly weaker than functional cohesion
B. Sequential cohesion is slightly stronger than functional cohesion
C. Sequential cohesion is much stronger than functional cohesion
D. Sequential cohesion is slightly weaker than functional cohesion

4.A class named student must have a constructor whose name is
A. student
B. ~student
C. constructor
D. student

5.The statement double val[15]={44.123456};
A. assigns the value 44.123456 to all members of the array val
B. assigns the value 44.123456 to val[0] and 0 to the rest of the members
C. gives an error message
D. assigns the value 44.123456 to all members of the array val

6.Which of the following C++ expressions will find the square root of the number 16?
A. pow (16, 2) (b) root (16, 2)
B. sqroot (16)
C. sqrt (16, 2)
D. pow (16, 2) (b) root (16, 2)

7.It is illegal to make objects of one class members of another class
A. TRUE
B. FALSE
C. depends upon the kind of object
D. TRUE

8.Catch blocks must _____
A. appear in every object-oriented program
B. appear within try blocks
C. appear immediately after throw statements
D. appear in every object-oriented program

9.An exception specification begins with the keyword _____
A. exception
B. try
C. throw
D. exception

10.You construct a class in two sections, known as the _____
A. header and body
B. type and parameters
C. declaration and implementation
D. header and body

11.The statement i*=3 is equivalent to
A. i = 3*
B. i = 3
C. i* = 3
D. i = 3*

12.The complement operator is represented by the symbol
A. ~
B. ^
C. i
D. ~

13.One of the relational operators in the C language is
A. !=
B. &&
C. !
D. !=

14.Within a program, you can instantiate ________that have a class template type
A. classes
B. functions
C. parameters
D. classes

15.The rules to any programming language are its ___
A. syntax
B. interpretation
C. logic
D. syntax

16.Which of the following backslash codes used for bell?
A. 
B. a
C.
D. 

17.The last statement in a value-returning function is always __
A. };
B. result expression;
C. return;
D. };

18.One of the logical operators in the C language is represented by the symbol
A. AND
B. &&
C. >=
D. AND

19.Which of the following tells C++ to display numbers in fixed notation?
A. setiosflags(fixed)
B. setiosflags(fixed: :is)
C. setiosflags(ios, fixed)
D. setiosflags(fixed)

20.The #include instruction is called a
A. direction
B. directive
C. merge instruction
D. direction

21.Another drawback to returning an error code from a function is that any error code returned by the function
A. must be of the same type as return type of the function
B. must not be a character
C. cannot be checked in a main() program
D. must be of the same type as return type of the function

22.Classes hold _____
A. data
B. methods
C. both data and methods
D. data

23.In C++, the address operator is the following symbol _____
A. >>�
B. &
C. *
D. >>�

24.The function that takes arguments to set the bits of cout is _____
A. setf()
B. bitset()
C. ios()
D. setf()

25.When you declare a pointer, you must give it a _____
A. type
B. type and name
C. type, name, and value
D. type

26.You typically initialize Short Integer, Integer, and Long Integer variables to
A. a space enclosed in double quotes
B. a space enclosed in single quotes
C. the letter O
D. a space enclosed in double quotes

27.Assume that a variable will need to store only integers in the range of 1 through 20000. The most efficient data type for the variable is _____
A. character
B. float
C. integer
D. character

28.Which of the following is true?
A. iostream is derived from istream
B. iostream is derived from ostream
C. ostream is derived from iostream
D. iostream is derived from istream

29.Programmer-defined functions can be
A. value-returning functions only
B. void functions only
C. either value-returning or void functions
D. value-returning functions only

30.Which of the following are valid characters for a numeric literal constant?
A. a decimal point
B. the letter e
C. a minus sign
D. a decimal point


Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers