Computer Science :: All Aptitude Test ::

1.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

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

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

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

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

6.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

7.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

8.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

9.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

10.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

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

12.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

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

14.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

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

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

17.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

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

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

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

21.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

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

23.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

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

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

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

27.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

28.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

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

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


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