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

Which of the following is the correct C++ syntax to allocate space dynamically for an array of 10 int?

  1. A
    new int(10) ;
  2. B
    new int[10] ;
  3. C
    int new(10) ;
  4. D
    int new[10];
Show correct answer

Correct answer: B. new int[10] ;

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

How many bytes will the pointer intPtr of type int move in the following statement? intPtr += 3 ;

  1. A
    3 bytes
  2. B
    6 bytes
  3. C
    12 bytes
  4. D
    24 bytes
Show correct answer

Correct answer: C. 12 bytes

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

Class is a user defined___________.

  1. A
    data type
  2. B
    memory referee
  3. C
    value
  4. D
    none of the given options
Show correct answer

Correct answer: A. data type

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

Which one of the following is the declaration of overloaded pre-increment operator implemented as member function?

  1. A
    Class-name operator +() ;
  2. B
    Class-name operator +(int) ;
  3. C
    Class-name operator ++() ;
  4. D
    Class-name operator ++(int)
Show correct answer

Correct answer: C. Class-name operator ++() ;

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

Which of the following statement is best regarding declaration of friend function?

  1. A
    Friend function must be declared after public keyword
  2. B
    Friend function must be declared after private keyword
  3. C
    Friend function must be declared at the top within class definition
  4. D
    It can be declared anywhere in class as these are not affected by the public and private keywords
Show correct answer

Correct answer: D. It can be declared anywhere in class as these are not affected by the public and private keywords

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

All A template function must have at least ---------- generic data type

  1. A
    Zero
  2. B
    One
  3. C
    Two
  4. D
    Three
Show correct answer

Correct answer: B. One

Check community answers against your course notes.Question permalink ↗