Programming Concepts

C++ Programming Concepts

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Object is a/an ____________.

  1. entity of the class
  2. instance of the class
  3. attribute of the class
  4. method of the class
  5. function of the class
Question 2 Multiple Choice (Single Answer)

What feature allows us to reuse code?

  1. Data abstraction
  2. Polymorphism
  3. Inheritance
  4. Function overloading
  5. Virtual function
Question 3 Multiple Choice (Single Answer)

Which statement takes control to a particular statement?

  1. break
  2. goto
  3. continue
  4. if
  5. else
Question 4 Multiple Choice (Single Answer)

The concept of bundling data and function in a single unit is called __________.

  1. data abstraction
  2. encapsulation
  3. polymorphism
  4. inheritance
  5. virtual function
Question 5 Multiple Choice (Single Answer)

Which statement takes the control to the beginning of the loop?

  1. goto
  2. break
  3. continue
  4. if else
  5. switch
Question 6 Multiple Choice (Single Answer)

The programs are written by dividing into smaller units known as _________.

  1. procedures
  2. functions
  3. methods
  4. only 1 and 2
  5. only 1, 2 and 3
Question 7 Multiple Choice (Single Answer)

Which of the following is not an advantage of Object Oriented Programming?

  1. Reusability of code
  2. Polymorphism
  3. Data abstraction
  4. Encapsulation
  5. Virtual function
Question 8 Multiple Choice (Single Answer)

Which statement takes the control out of the loop?

  1. goto
  2. continue
  3. break
  4. if else
  5. switch
Question 9 Multiple Choice (Single Answer)

Which header file should be included to use exit function?

  1. iostream.h
  2. stdlib.h
  3. conio.h
  4. process.h
  5. dos.h
Question 10 Multiple Choice (Single Answer)

Conditional operator is an alternative to __________.

  1. switch
  2. break
  3. continue
  4. if else
  5. goto
Question 11 Multiple Choice (Single Answer)

'char st[]; is a valid statement'. This statement is

  1. true
  2. false
  3. finite
  4. infinite
  5. not define
Question 12 Multiple Choice (Single Answer)

void print() would return __________.

  1. null value
  2. integer
  3. float
  4. char
  5. based on function
Question 13 Multiple Choice (Single Answer)

How maximum char will allow char st[20] to be stored in the string?

  1. 20
  2. 19
  3. 18
  4. 21
  5. 17
Question 14 Multiple Choice (Single Answer)

An array int a[5][6] can store __________.

  1. 29 numbers
  2. 30 numbers
  3. 31 numbers
  4. 28 numbers
  5. no number
Question 15 Multiple Choice (Single Answer)

Index a[5] represents the number of integer in array ___________.

  1. 5
  2. 6
  3. 7
  4. 4
  5. 0
Question 16 Multiple Choice (Single Answer)

In which type of function does 'call the value' in the original variable remain the same?

  1. Pass by reference
  2. Pass by value
  3. Pass by object
  4. Pass by integer
  5. Pass by float
Question 17 Multiple Choice (Single Answer)

Which keyword is used to create structure?

  1. enum
  2. union
  3. array
  4. struct
  5. main
Question 18 Multiple Choice (Single Answer)

When constructor is invoked, _____________.

  1. object is destroyed
  2. object is created
  3. class is destroyed
  4. class is created
  5. both object and class are created
Question 19 Multiple Choice (Single Answer)

Which function is used to destroy the memory of an object?

  1. Constructor
  2. Destructor
  3. Virtual function
  4. Friend function
  5. Static function
Question 20 Multiple Choice (Single Answer)

By using which operator member can ' function of a class' be defined outside the class?

  1. Scope operator
  2. Resolution operator
  3. Scope resolution operator
  4. Unary operator
  5. Binary operator