Computer Science :: All Aptitude Test ::

1.The number of structures than can be declared in a single statement is
A. one
B. two
C. three
D. one

2.The cout << sales[0] + sales[1]; statement will______
A. display 22000
B. display 10000 + 12000
C. display sales[0] + sales[l]
D. display 22000

3.The most efficient data type for a variable that stores the letter C is the _____ data type
A. Character
B. Double
C. Float
D. Character

4.The C++ operator used to allocate memory is _________
A. mem
B. allocate
C. new
D. mem

5.Assume that your version of C++ can recognize only the first 8 characters of an identifier name, through identifier names may be arbitrarily long. Which of the following identifier names is not distinct:
A. list, list2
B. address, Address
C. identifier_l, identifier_2
D. list, list2

6.Object is to class as _____
A. library is to book
B. mother is to daughter
C. Plato is to philosopher
D. library is to book

7.A derived class may also be called a
A. subclass
B. super class
C. parent class
D. subclass

8.The C++ keyword for declaring a variable that contains a decimal point is _____
A. dec
B. decimal
C. float
D. dec

9.When you define an object that is a member of a class, such as Student Abby; _____
A. a block of memory is set aside and all data members are assigned valid values
B. a block of memory is set aside
C. no memory is set aside until values are defined
D. a block of memory is set aside and all data members are assigned valid values

10.A program can directly access the _____ members of a class
A. hidden
B. private
C. public
D. hidden

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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