cpp-programming-mcqs - Set (1)

Correct Answer: Orange && Worng Answer: Red

1. Which datatype is used to represent the absence of parameter ?

  • (A). int
  • (B). short
  • (C). void
  • (D). float
  • View Answer

    Explanation: Because void specifies an empty set of values/parameters.

    2. In C++ what is the sign of character type by default ?

  • (A). Signed
  • (B). Unsigned
  • (C). Implementation dependent
  • (D). None of the above
  • View Answer

    Explanation: Not Avilable

    3. The size of an object or a type can be determined using which operator ?

  • (A). malloc
  • (B). sizeof
  • (C). alloc
  • (D). calloc
  • View Answer

    Explanation: Not Avilable

    4. Which of the following will not return a value ?

  • (A). null
  • (B). void
  • (C). empty
  • (D). free
  • View Answer

    Explanation: void represents an empty set of values.

    5. In which type does enumerators are stored by the compiler ?

  • (A). string
  • (B). integer
  • (C). float
  • (D). None of the above
  • View Answer

    Explanation: Not Avilable

    6. The constants are also called as :

  • (A). Const.
  • (B). Preprocessor
  • (C). Literals
  • (D). None of the above
  • View Answer

    Explanation: Not Avilable

    7. The data elements in structure are also known as what ?

  • (A). Objects
  • (B). Members
  • (C). Data
  • (D). None of the above
  • View Answer

    Explanation: Not Avilable

    8. What is this operator called ?

  • (A). Conditional
  • (B). Relational
  • (C). Casting Operator
  • (D). None of the above
  • View Answer

    Explanation: Not Avilable

    9. How many type of comments are there in C++ ?

  • (A). 1
  • (B). 2
  • (C). 3
  • (D). 4
  • View Answer

    Explanation: There are two types of comments in C++. Single line comments uses double slash //. Multiple line comments uses /* comment inside */.

    10. Where does the execution of the program starts ?

  • (A). User-defined function
  • (B). Main function
  • (C). Void function
  • (D). None of the above
  • View Answer

    Explanation: Not Avilable

    11. How many minimum number of functions are need to be presented in C++ ?

  • (A). 0
  • (B). 1
  • (C). 2
  • (D). 3
  • View Answer

    Explanation: In C++ we require atleast 1 function to execute C++ program taht is main function.

    12. In which of the follwing we cannot overload the function ?

  • (A). Return function
  • (B). Caller
  • (C). Called function
  • (D). None of the above
  • View Answer

    Explanation: Not Avilable

    13. When out function need to return anything means what will we use/send as paramenter in function ?

  • (A). Void
  • (B). Blank space
  • (C). Both Void and Blank space
  • (D). None of the above
  • View Answer

    Explanation: Not Avilable

    14. What does your class can hold ?

  • (A). Data
  • (B). Functions
  • (C). Both data and functions
  • (D). None of the above
  • View Answer

    Explanation: Not Avilable

    15. Where does the object is created ?

  • (A). Class
  • (B). Constructor
  • (C). Destructor
  • (D). Attributes
  • View Answer

    Explanation: Not Avilable