TRB-CS-VIP ONLINE COACHING CENTER (QUIZ-7) *C++ PROGRAMMING*
TRB-CS-VIP ONLINE COACHING CENTER (QUIZ-7) *C++ PROGRAMMING*
Quiz
In the C language, the character type of constant is delimited by using
- single quotes
- double quotes
- parenthesis
- #
One way in which a structure differs from an array is that _____
- a structure may have members of more than one type
- a structure must have members that; are all the same type
- art array may have members of more than one type
- there is no difference between a structure and an array
. A default constructor _____
- takes no arguments
- has default values for all its arguments
- either (a) or (b)
- neither (a) nor (b).
204 . The number 125.35 is a _____
- character literal constant
- numeric literal constant
- string literal constant
- variable
205 . When a class serves as a base class to others, _____
- all of its members are inherited
- all of its members are inherited, except for any private members
- all of its members are inherited, except for any protected members
- None of its members is inherited unless specifically "listed
206 . Storing a class definition in a separate file is an example of
- polymorphism
- name mangling
- implementation hiding
- inheritance
Which is true?
- Sequential cohesion is slightly weaker than functional cohesion
- Sequential cohesion is slightly stronger than functional cohesion
- Sequential cohesion is much stronger than functional cohesion
- Neither sequential cohesion nor functional cohesion is stronger than the other
. A class named student must have a constructor whose name is
- student
- student
- constructor
- any legal C++ name.
209 . The statement double val[15]={44.123456};
- assigns the value 44.123456 to all members of the array val
- assigns the value 44.123456 to val[0] and 0 to the rest of the members
- gives an error message
- assigns the value 44.12345 to val[1] and val[5]
210 . Which of the following C++ expressions will find the square root of the number 16?
- pow (16, 2) (b) root (16, 2)
- sqroot (16)
- sqrt (16, 2)
- sqrt (16)
211 . Catch blocks must _____
- appear in every object-oriented program
- appear within try blocks
- appear immediately after throw statements
- appear immediately after try blocks
An exception specification begins with the keyword ____
- exception
- try
- throw
- catch
213 . You construct a class in two sections, known as the _____
- header and body
- type and parameters
- declaration and implementation
- pointer and variable
The statement i*=3 is equivalent to
- i = 3*
- i = 3
- i* = 3
- i = i * 3
. The complement operator is represented by the symbol
- ~
- ^
- i
- <
One of the relational operators in the C language is
- !=
- &&
- !
- #
Within a program, you can instantiate ________that have a class template type
- classes
- functions
- parameters
- objects
The rules to any programming language are its _______
- syntax
- interpretation
- logic
- customs
Which of the following backslash codes used for bell?
- \b
- a
- \r
- \s
The last statement in a value-returning function is always _____
- A. };
- result expression;
- return
- return expression;
One of the logical operators in the C language is represented by the symbol
- AND
- &&
- >=
- <=
Which of the following declares and initializes an Integer variable named numltems?
- int numltems = 0;
- int numltems = '0';
- integer numltems = 0;
- numltems int = 0;
Which of the following tells C++ to display numbers in fixed notation?
- setiosflags(fixed)
- setiosflags(fixed: :is)
- setiosflags(ios, fixed)
- setiosflags(ios::fixed)
. The #include instruction is called a
- direction
- directive
- merge instruction
- statement
Another drawback to returning an error code from a function is that any error code returned by the function
- must be of the same type as return type of the function
- must not be a character
- cannot be checked in a main() program
- can have multiple meanings