Home

Computer Science and IT MCQs

Introduction to Programming

Quiz # 4, MCQs





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



The Timer has started 10:00



  1. 1)

    The normal source of cin object is,


    • A) File
    • B) Disk
    • C) Keyboard
    • D) RAM

  2. 2)

    Which of the following is correct way to initialize a variable x of int type with value 10?


    • A) int x ; x = 10;
    • B) int x = 10;
    • C) int x, x = 10;
    • D) x = 10;

  3. 3)

    Consider the following code segment. What will be the output of the following program?

    int func(int) ;
    int num = 10 ;
    int main(){
    int num ;
    num = 5 ;
    cout << num ;
    cout << func(num) ;
    }
    int func(int x){
    return num ;
    }


    • A) 5, 5
    • B) 10, 5
    • C) 5, 10
    • D) 10, 10

  4. 4)

    The first parameter of operator function for << operator,


    • A) Must be passed by value
    • B) Must be passed by reference
    • C) Can be passed by value or reference
    • D) Must be object of class

  5. 5)

    While calling function, the arguments are assigned to the parameters from _____________.


    • A) left to right.
    • B) right to left
    • C) no specific order is followed
    • D) none of the given options.

  6. 6)

    Classes defined inside other classes are called ________ classes


    • A) looped
    • B) nested
    • C) overloaded
    • D) none of the given options.

  7. 7)

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


    • A) can not be replaced
    • B) None of the given options
    • C) Remain constant.
    • D) can be changed by some operation

  8. 8)

    A template function must have


    • A) One or more than one arguments
    • B) Only one argument
    • C) Zero arguments
    • D) None of the given options

  9. 9)

    Structured Query Language is used for ______________


    • A) Databases Management
    • B) Networks
    • C) Writing Operating System
    • D) none of the given options

  10. 10)

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


    • A) Only block of memory is deallocated for objects
    • B) Only destructor is called for objects
    • C) Memory is deallocated first before calling destructor
    • D) Destructor is called first before deallocating memory