GAT Subject :: All Aptitude Test ::

Hassan
1.Any #include files may contain
A. constants
B. variables
C. functions
D. constants

2.When a break statement is used in a loop, the control skips the rest of the statements in the loop after it and jumps
A. to the last lines in the program
B. to the next statement written after the body of the loop
C. to the first statement in the body of the loop
D. to the last lines in the program

3.The function that takes arguments to set the bits of count is _____
A. setf()
B. bitsef()
C. ios()
D. setf()

4.When two types are used in a function template and one is labeled T, the other
A. must also be named T
B. must be named U
C. can be any legal C++ identfier
D. must also be named T

5.The best-written classes have
A. all functions private
B. all data public
C. no functions
D. all functions private

6.Making class members inaccessible to nonmember functions is an example of
A. polymorphism
B. data hiding
C. redundancy
D. polymorphism

7.Providing two or more constructors for the same class _____
A. requires different argument lists
B. requires different constructor names
C. requires different constructor types
D. requires different argument lists

8.3 is a _____ constant
A. character literal
B. named literal
C. numeric literal
D. character literal

9._____ variables remain in memory until the statement block ends
A. Area
B. Global
C. Local
D. Area

10.An address is a _____ , while a pointer is a _____
A. array, variable
B. constant, variable
C. variable, position
D. array, variable

11.Procedural cohesion is similar to sequential cohesion, except that with procedural cohesion _____
A. the tasks are not done in order
B. the tasks are simpler
C. the tasks share data
D. the tasks are not done in order

12.Which of the following creates an animal object named dog?
A. animal "dog";
B. animal dog;
C. dog "animal";
D. animal "dog";

13.The getline() function reads a line of text until _____
A. the length used as the second argument is reached
B. the character used as the third argument is reached
C. either (a) or (b)
D. the length used as the second argument is reached

14.The extraction operator >> is a(n)
A. overloaded function
B. C++ class
C. C++ object
D. overloaded function

15.Assuming the following three operators appear in an expression (without parentheses), which of the operators will be performed first?
A. &&
B. !
C. ||
D. &&

16.The code that you enter into a C++ program is called _____
A. console code
B. object code
C. project code
D. console code

17.If a base class member is private, then
A. if a derived class uses the public access specifier, the data member becomes public
B. if a derived class uses the protected access specifier, the data member becomes protected
C. both (a) and (b)
D. if a derived class uses the public access specifier, the data member becomes public

18.Which of the following instructions tells C++ to merge the source code from the iostream.h file into the current file?
A. #include
B. #include iostream.h
C. #include
D. #include

19.The statement double total = 0.0; performs _____
A. assignment
B. initialization
C. rationalization
D. assignment

20.The two parts of a function are the
A. header and footer
B. declarations and statements
C. legs and feet
D. header and footer

21.The general principle underlying object-oriented error handling is that a called function should __?
A. neither check for, nor handle errors
B. check for errors but not be required to handle any detected
C. handle errors, but not check for them
D. neither check for, nor handle errors

22.Reference variables and const class member
A. must be assigned values in any derived class
B. must never be initialized in a base class
C. must be initialized, rather than assigned values
D. must be assigned values in any derived class

23.The actual arguments cannot he
A. a constant or a variable
B. of a different type from the corresponding formal arguments
C. other functions
D. a constant or a variable

24.The function stricmp("Jose", "JOSE") will return _____
A. -1
B. 0
C. 1
D. -1

25.Which is true?
A. Coincidental cohesion is stronger than procedural cohesion
B. Logical cohesion is stronger than coincidental cohesion
C. Sequential cohesion is weaker than temporal cohesion
D. Coincidental cohesion is stronger than procedural cohesion

26.A predefined function that may be used to handle memory allocation errors is
A. handle_error
B. set_new_handler
C. new_fix
D. handle_error

27.A function in a derived class that has the same name as a function in the parent class _____
A. will cause an error message to display
B. will override the base class function
C. will be overridden by the base class function
D. will cause an error message to display

28.The _____ function returns the uppercase equivalent of a character
A. caseupper
B. charupper
C. toupper
D. caseupper

29.When you instantiate a derived class object, a constructor for the derived class _____
A. is not called
B. is called prior to the base class constructor
C. is called simultaneously with the base class constructor
D. is not called

30.A constructor may be _____
A. provided automatically by C++
B. written by you
C. either (a) or (b).
D. provided automatically by C++


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