C Interview Questions and Answers - Set 07 - ObjectiveBooks

C Interview Questions and Answers - Set 07

Practice Test: Question Set - 07


1. A function that is prototyped as double calculate(int num); may ________
    (A) Receive a double constant such as 3.9
    (B) Receive a double variable
    (C) Either (a) or (b)
    (D) Neither (a) nor (b)

2. The null character is represented by
    (A) \n
    (B) \0
    (C) \o
    (D) \r

3. If p and q are assigned the values 2 and 3 respectively then the statement p = q++
    (A) Gives an error message
    (B) Assigns a value 4 to p
    (C) Assigns a value 3 to p
    (D) Assigns a value 5 to p

4. The number of the relational operators in the C language is
    (A) Four
    (B) Six
    (C) Three
    (D) One

5. The function whose prototype is void getData(Item *thing); receives
    (A) A pointer to a structure
    (B) A reference to a structure
    (C) A copy of a structure
    (D) Nothing

6. Functions that returns information about an object's state can be classified as ________
    (A) Inspector functions
    (B) Mutator functions
    (C) Auxiliary functions
    (D) Manager functions

7. Reserving memory during program execution is known as reserving it
    (A) Dynamically
    (B) Statically
    (C) Functionally
    (D) Powerfully

8. Object is to class as _______
    (A) Library is to book
    (B) Mother is to daughter
    (C) Plato is to philosopher
    (D) President is to Lincoln

9. Template classes that have already been written to perform common class tasks are called _______
    (A) Container classes
    (B) Receptacle classes
    (C) Repository classes
    (D) Alembic classes

10. The braces that surround the code in a 'C program
    (A) Show what code goes in a particular function
    (B) Delimit a section of code
    (C) Separate the codes from the constant
    (D) Separate the source file from the subject file

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

12. A major advantage of inheritance is
    (A) Reducing the time it takes to create new objects
    (B) Not having to think about how objects will be used
    (C) Reducing the amount of memory required to execute a program
    (D) Enabling people who have not studied programming to create useful applications

13. One of the valid escape sequences used in the C language is
    (A) \z
    (B) \N
    (C) \t
    (D) \s

14. The break statement is
    (A) A preprocessor directive
    (B) An operator in the C++ language
    (C) A keyword in the C++ language
    (D) Switch in the C++ language

15. Which of the following, if any, are invalid names for a variable?
    (A) bankAccountNumber
    (B) first_Name
    (C) doubleNumber
    (D) operator

Show and hide multiple DIV using JavaScript View All Answers

 Next Tests: