New past papers will be uploaded soon! New past papers will be uploaded soon!

Free MCQs & Online Quiz Practice for Exams

Review Mode Quiz Mode

    Q: Observe the following statements and decide what they do: string mystring; getline(cin, mystring);

    A) Reads a line of string from cin into E
    B) Reads a line of string from mystring
    C) Cin can't be used this way
    D) Getline is not a function

    Q: Which of the header files must be included to use string stream?

    A) <iostream>
    B) <string>
    C) <sstring>
    D) <sstream>

    Q: The location number of an item in an array is called?

    A) Data
    B) Value
    C) Index
    D) Constant

    Q: Strings are character arrays. The last index of it contains the null character?

    A) \n
    B) \t
    C) \0
    D) \1

    Q: The phenomenon of having two or more functions in a program with the same names but different number and types of parameters is known as?

    A) Inline Function
    B) Nested Function
    C) Function Overloading
    D) Recursive Function

    Q: We declare a function with _____ if it does not have any return type?

    A) Long
    B) Double
    C) Void
    D) Int

    Q: Arguments of a function are separated with?

    A) Comma(,)
    B) Colon(:)
    C) Semicolon(;)
    D) Hyphen(-)

    Q: Variables inside parenthesis of function declarations have _____ level access?

    A) Local
    B) Global
    C) Module
    D) Universal

    Q: Observe the following function declaration: int divide(int a, int b=2). Which is correct?

    A) Variable b is of integer type and will always have value 2
    B) Variable a and b are int type and the initial value of both variables is 2
    C) Variable b is international scope
    D) Variable b will have value 2 if not specified when calling the function

    Q: If we have the statement int *Ptr; then to what does Ptr point?

    A) Points to an integer type variable
    B) Points to a character type variable
    C) Points to a floating point type variable
    D) Points to null variable

    Q: A pointer is?

    A) A keyword used to create variables
    B) A variable that stores address of an instruction
    C) A variable that stores address of another variable
    D) All of the above

    Q: The operator used to get value at address stored in a pointer variable is?

    A) *
    B) &
    C) &&
    D) ||

    Q: Which of the statements is correct about the following segment of code: int i=10; int *j=&i;?

    A) j and i are pointers to an int
    B) i is a pointer to an int and stores address of j
    C) j is a pointer to an int and stores address of i
    D) j is a pointer to a pointer to an int and stores address of i

    Q: In pointers, dereference operator * is used to?

    A) Address the value of the pointer variable
    B) Points to the value stored in the variable pointed by the pointer variable
    C) Both A and B
    D) None of the above

    Q: A constructor is called whenever?

    A) An object is destroyed
    B) An object is created
    C) A class is declared
    D) A class is used

    Q: Destructor is used for?

    A) Initializing the values of data members in an object
    B) Initializing arrays
    C) Freeing memory allocated to the object of the class when it is created
    D) Creating an object

    Q: The name of a destructor is always preceded by the symbol?

    A) +
    B) %
    C) ~
    D) &

    Q: Constructors are commonly used for?

    A) Constructing programs
    B) Running classes
    C) Initializing objects
    D) All of the above

    Q: Inheritance is used to?

    A) Increase the size of a program
    B) Make the program simpler
    C) Provide the facility of code re-usability
    D) Provide the facility of data hiding

    Q: eof stands for?

    A) Errors-on-files
    B) End-of-file
    C) Exit-of-file
    D) Execution of file
Bootstrap Footer Square Arrow Go to Top Button