Home

Computer Science and IT MCQs

Introduction to Programming

Quiz # 3, MCQs





NOTE: Attempt all Questions to see the Result at the bottom of this page.



The Timer has started 10:00



  1. 1)

    width() is member function of _____________


    • A) cin object
    • B) cout object
    • C) Both cin and cout object
    • D) None of the given option

  2. 2)

    Templates are not type-safe.


    • A) True
    • B) False

  3. 3)

    In if structure the block of statements is executed only,


    • A) When the condition is false
    • B) Use templates
    • C) Use strings to store all types
    • D) None of the given options

  4. 4)

    In if structure the block of statements is executed only,


    • A) When the condition is false
    • B) When it contain arithmetic operators
    • C) When it contain logical operators
    • D) When the condition is true

  5. 5)

    Header file: fstream.h includes the definition of the stream classes __________.


    • A) ifstream, fstream, cout
    • B) ifstream, fstream, ofstream
    • C) fstream, cin, cout
    • D) None of the above

  6. 6)

    To access the data members of structure _______ is used.


    • A) dot operator (.)
    • B) * operator
    • C) U operator
    • D) None of given.

  7. 7)

    eof( ), bad( ), good( ), clear( ) all are manipulators.


    • A) True
    • B) False

  8. 8)

    Which kind of functions can access private member variables of a class?


    • A) Friend functions of the class
    • B) Private member functions of the class
    • C) Public member functions of the class
    • D) Friend, private and public functions

  9. 9)

    The return type of operator function must always be void.


    • A) True
    • B) False

  10. 10)

    Friend function of a class is ______________ .


    • A) Member function
    • B) Non-member function
    • C) Private function
    • D) Public function