GAT Subject :: All Aptitude Test ::

Hassan
1.Any output manipulator function you create _____
A. should take as an argument an instance of ostream as a reference
B. should return void
C. must be a member function of the ostream class
D. should take as an argument an instance of ostream as a reference

2.The instructions you enter into the computer are called the _____
A. edited code
B. machine code
C. object code
D. edited code

3.The String data type is an extension of the _____ data type
A. Character
B. Double
C. Letter
D. Character

4.An advantage of using local variables is that _____
A. they are known to all functions in the file
B. names used in one function do not affect data stored in variables with the same names in other functions
C. values given to local variables are retained when those parameters go out of scope
D. they are known to all functions in the file

5.The difference between a return and a throw is that _____
A. with a throw, no value can be sent
B. with a return, no value can be sent
C. with a throw, execution takes place at the location from which the function was called
D. with a throw, no value can be sent

6.The string HELLO WORLD needs
A. 11 bytes
B. 12 bytes
C. 10 Bytes
D. 11 bytes

7.Library header files usually contain
A. complete functions
B. parts of functions
C. function prototypes for functions stored in other files
D. complete functions

8.A C++ term meaning "generic" is
A. argument
B. parameterized
C. universal
D. argument

9.Before object-oriented exception handling was practiced, _____
A. no run-time errors occurred
B. programmers could not deal with run-time errors
C. the most popular error-handling method was to terminate the program
D. no run-time errors occurred

10.The preprocessor directive always ends with
A. a comma
B. a semicolon
C. neither a semicolon nor a comma
D. a comma

11.A constructor initialization list produces similar results to
A. overriding
B. assignment
C. redeclaring
D. overriding

12.Which of the following stream manipulators advances the cursor to the next line on the computer screen?
A. adin
B. advin
C. edlin
D. adin

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

14.Which function is most likely to have procedural cohesion?
A. main()
B. findSquareRoot()
C. getSaleSubtractDiscountAddTax()
D. main()

15.A pointer is
A. the address of a variable
B. an indication of the variable to be accessed next
C. a variable for storing addresses
D. the address of a variable

16.Which of the following statements will assign the address of the age variable to the agePtr pointer?
A. agePtr = &age;
B. agePtr = *age;
C. &agePtr = age;
D. agePtr = &age;

17.In the statement template,
A. T is a class
B. T is a scalar variable
C. either (a) or (b)
D. T is a class

18.The null character is represented by
A.
B.
C. o
D.

19.The break statement is
A. a preprocessor directive
B. an operator in the C++ language
C. a keyword in the C++ language
D. a preprocessor directive

20.A variable w with a value 67 may be defined with _______
A. int w = 67;
B. int w(67);
C. int 67(w);
D. int w = 67;

21.An expression contains relational, assignment and arithmetic operators. In the absence of parentheses, the order of evaluation will be
A. assignment, relational, arithmetic
B. arithmetic, relational, assignment
C. relational, arithmetic, assignment
D. assignment, relational, arithmetic

22.The keyword virtual indicates that
A. a derived class has public access to a base class
B. more than one base class exists
C. a base class should be used only once in inheritance
D. a derived class has public access to a base class

23.If you declare two objects as Customer firstCust, secondCust; which of the following must be true?
A. Each object will store a separate copy of any static member data
B. Each object will store a separate copy of any member functions
C. Each object will store a separate copy of any nonstatic data members
D. Each object will store a separate copy of any static member data

24.Variables that are declared in a block are known as _____ variables to that block
A. confined
B. local
C. global
D. confined

25.The pow and sqrt functions return a(n) _____ type number
A. double
B. float
C. integer
D. double

26.Declaring variables is advantageous because it
A. avoids errors from misspelled variable names {b) helps the linker work efficiently
B. simplifies the writing of very short programs
C. All of the above
D. avoids errors from misspelled variable names {b) helps the linker work efficiently

27.The generic name used for unexpected errors that occur during the execution of a program is
A. infractions
B. exceptions
C. déviations
D. infractions

28.The switch variable can be of
A. int type only
B. char type only
C. both int as well as char type
D. int type only

29.Reference variables and const class members _____
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

30.You can code a default exception handler by creating a catch block
A. with no arguments
B. with a void argument
C. with an ellipsis as its argument
D. with no arguments


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