YOUR SUBJECT CS201 Introduction to ProgrammingChange subject ↗
PRACTICE AT YOUR OWN PACE

CS201 practice questions

Think through the options before revealing the answer. Use the term filter to focus your revision.

86 questions
CS201 · Midterm#26

If we define an identifier with the statement #define PI 3.1415926 then during the execution of the program
the value of PI __________.

  1. A
    can not be replaced
  2. B
    None of the given options
  3. C
    Remain constant
  4. D
    can be changed by some operation
Show correct answer

Correct answer: B. None of the given options

Check community answers against your course notes.Question permalink ↗
CS201 · Midterm#25

The stream insertion and stream extraction operators are already overloaded for______.

  1. A
    User-defined data types
  2. B
    Built-in data types
  3. C
    User-defined and built-in data types
  4. D
    None of the given options
Show correct answer

Correct answer: B. Built-in data types

Check community answers against your course notes.Question permalink ↗
CS201 · Midterm#24

Which situation would require the use of a non-member overloaded operator?

  1. A
    The overloaded operator is an Assignment operator
  2. B
    The left most operand is an object of a class
  3. C
    The left operand is built-in data type
  4. D
    The operator returns a reference
Show correct answer

Correct answer: B. The left most operand is an object of a class

Check community answers against your course notes.Question permalink ↗
CS201 · Midterm#23

Like member functions, ______ can also access the private data members of a class.

  1. A
    Non-member functions
  2. B
    Friend function
  3. C
    Any function outside class
  4. D
    None of the given options
Show correct answer

Correct answer: B. Friend function

Check community answers against your course notes.Question permalink ↗
CS201 · Midterm#22

new and delete are _____ whereas malloc and free are _____.

  1. A
    Functions, operators
  2. B
    Classes, operators
  3. C
    Operators, functions
  4. D
    Operators, classes
Show correct answer

Correct answer: C. Operators, functions

Check community answers against your course notes.Question permalink ↗
CS201 · Midterm#21

_______ is used to trace the logic of the program and correct the logical errors.

  1. A
    Compiler
  2. B
    Editor
  3. C
    Linker
  4. D
    Debugger
Show correct answer

Correct answer: D. Debugger

Check community answers against your course notes.Question permalink ↗
CS201 · Midterm#20

Consider the following code segment. What will be the output of following code?
Int addValue (int *a){
int b = (*a) + 2;
return b ;
}
main () {
int x =6 ;
cout << x << “,” ;
cout << addValue(&x) << “,” ;
cout << x ;
}

  1. A
    6,8,6
  2. B
    6,6,8
  3. C
    6,8,8
  4. D
    6,6,6
Show correct answer

Correct answer: A. 6,8,6

Check community answers against your course notes.Question permalink ↗
CS201 · Midterm#19

What will be the value of ‘a’ and ‘b’ after executing the following statements?
A = 3;
b = a++;

  1. A
    3, 4
  2. B
    4, 4
  3. C
    3, 3
  4. D
    4, 3
Show correct answer

Correct answer: D. 4, 3

Check community answers against your course notes.Question permalink ↗
CS201 · Midterm#18

We can not define a function as a friend of a Template class.

  1. A
    True
  2. B
    False
Show correct answer

Correct answer: B. False

Check community answers against your course notes.Question permalink ↗
CS201 · Midterm#17

Computer can understand only machine language code.

  1. A
    True
  2. B
    False
Show correct answer

Correct answer: A. True

Check community answers against your course notes.Question permalink ↗