Alien head

Language C++

Description: Multiple choice questions based on understanding of C++ language
Number of Questions: 25
Created by:
Tags: OOPS C++ computer languages C++ skills OOPS in C++ C=C+1 Programming Fundamentals of Computer Programming Information Technology
Attempted 0/25 Correct 0 Score 0

A pointer is

  1. the address of a variable

  2. the data type of an address variable

  3. a variable for storing address

  4. an indication of variable to be accessed next


Correct Option: C

An array element is accessed by using

  1. the dot operator

  2. a member name

  3. an index number

  4. a FIFO method


Correct Option: C

A variable defined within a block is visible

  1. from the point of definition onward in the program

  2. throughout the function

  3. from the point of definition onward in the function

  4. from the point of definition onward in the block


Correct Option: D

A copy constructor is invoked when

  1. a function returns by value

  2. an argument is passed by value

  3. a function calls to another function

  4. an argument is passed by reference


Correct Option: A

Overloaded functions

  1. are a group of functions with the same name

  2. make life harder for programmers

  3. may fail unexpectedly due to over stress

  4. all have same number and type of arguments


Correct Option: A

The new operator

  1. returns a pointer to a variable

  2. creates a variable called new variable

  3. clears memory for a new variable

  4. tells how much memory is available


Correct Option: A

The break statement causes an exit

  1. only from the innermost loop

  2. only from the innermost switch

  3. from the innermost loop or switch

  4. from all loops or switches


Correct Option: C

A relational operator

  1. assigns one operand to another

  2. compares two operands

  3. logically combines two operands

  4. gets a numeric result


Correct Option: B

Inheritance is a way to

  1. make general classes into more specific classes

  2. pass arguments to objects of classes

  3. add features to existing classes by rewriting them

  4. improves data hiding and encapsulation


Correct Option: A

A function contained within a class is called

  1. a class

  2. an operator

  3. a data item

  4. a member function


Correct Option: D

The first element of the string is

  1. the name of string

  2. the first character in the string

  3. the length of string

  4. the name of array holding the string


Correct Option: B

When a multi-dimensional array is accessed, each array index is

  1. separated by commas

  2. surrounded by brackets and separated by commas

  3. surrounded by brackets

  4. separated by commas and surrounded by brackets


Correct Option: C

The scope resolution operator

  1. resolved ambiguity by specifying a particular class

  2. limits the visibility of variables

  3. informs which base class is derived

  4. ensures copying data types


Correct Option: A

The errors which are caused by events beyond the control of program are called

  1. synchronous exceptions

  2. asynchronous exceptions

  3. all of above

  4. none of these


Correct Option: B

Manipulators are used to

  1. allocate memory

  2. free allocated memory

  3. resolve scope of variable

  4. formats data display


Correct Option: D

Which of the following is enclosed in double quotation marks?

  1. Integer constant

  2. Floating Constant

  3. Character Constant

  4. String Constant


Correct Option: D

The keyword void is used to

  1. declare a member function that is defined in a subclass

  2. designate the absence of a type

  3. declare objects that can be modified outside of program control

  4. declare a synonym for an existing type


Correct Option: B

The exception is activated through which keyword?

  1. Try

  2. Catch

  3. Struct

  4. Throw


Correct Option: D

The identifiers which can not be used as names of variables or other user defined elements are called

  1. keywords

  2. constants

  3. tokens

  4. operators


Correct Option: A

The GOTO statement causes the control to go to

  1. an operator

  2. a label

  3. a function

  4. a variable


Correct Option: B

A friend function is used to

  1. avoid arguments between classes

  2. allow access to classes whose source code is unavailable

  3. allow one class to access an unrelated class

  4. increase the versatility of an member function


Correct Option: C

In a linked list

  1. each link contains a pointer to the next link

  2. an array of pointers points to the link

  3. no link contains data

  4. the links are stored in an array


Correct Option: A

A C++ stream is

  1. the flow of control through a function

  2. a flow of data from one place to another

  3. not related to a class

  4. takes no arguments


Correct Option: B

Which operator is used to denote 'not equal to'?

  1. <>

  2. ##

  3. !=

  4. :=


Correct Option: C

When a language has the capability to produce new data type, its called

  1. reproductive

  2. encapsulated

  3. extensible

  4. none of above


Correct Option: B
+ View questions