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#66

The number 544.53 must be stored in _____ data type.

  1. A
    int
  2. B
    short
  3. C
    float
  4. D
    char
Show correct answer

Correct answer: C. float

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

To include code from the library in the program, such as iostream, a directive would be called up using this command.

  1. A
    #include “iostream.h”
  2. B
    include <iostream.h>
  3. C
    include <iostream.h>
  4. D
    #include <iostream.h>
Show correct answer

Correct answer: D. #include <iostream.h>

Check community answers against your course notes.Question permalink ↗
CS201 · Final-term only#64

What is the sequence of event(s) when deallocating memory using delete operator?

  1. A
    Only block of memory is deallocated for objects
  2. B
    Only destructor is called for objects
  3. C
    Memory is de-allocated first before calling destructor
  4. D
    Destructor is called first before de-allocating memory
Show correct answer

Correct answer: D. Destructor is called first before de-allocating memory

Check community answers against your course notes.Question permalink ↗
CS201 · Final-term only#63

Within the statement obj1=obj2; obj1 will call the assignment operator function and obj2 will be passed as an argument to function.

  1. A
    True
  2. B
    False
Show correct answer

Correct answer: A. True

Check community answers against your course notes.Question permalink ↗
CS201 · Final-term only#62

All preprocessor directives are started with the symbol______.

  1. A
    *
  2. B
    +
  3. C
    @
  4. D
    #
Show correct answer

Correct answer: D. #

Check community answers against your course notes.Question permalink ↗
CS201 · Final-term only#61

Pointer is a variable which store,

  1. A
    Data
  2. B
    Memory Address
  3. C
    Data Type
  4. D
    Values
Show correct answer

Correct answer: B. Memory Address

Check community answers against your course notes.Question permalink ↗
CS201 · Final-term only#60

"delete" operator is used to return memory to free store, which is allocated by the "new" operator.

  1. A
    True
  2. B
    False
Show correct answer

Correct answer: A. True

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

A Matrix can be composed of ints, floats or doubles as their elements. Best way is to handle this

  1. A
    Write a separate class to handle each
  2. B
    Use templates
  3. C
    Use strings to store all types
  4. D
    None of the given options
Show correct answer

Correct answer: B. Use templates

Check community answers against your course notes.Question permalink ↗
CS201 · Final-term only#58

The precedence of an operator can be changed through operator overloading.

  1. A
    True
  2. B
    False
Show correct answer

Correct answer: B. False

Check community answers against your course notes.Question permalink ↗
CS201 · Final-term only#57

When a call to a user-defined function finishes, the variable defined inside the function is still in existence.

  1. A
    True
  2. B
    False
Show correct answer

Correct answer: B. False

Check community answers against your course notes.Question permalink ↗