Recent Trends in IT Solved MCQs

Multiple Choice Questions 35 Pages
FT

Contributed by

Falguni Talwar
Loading
  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI, PUNE 45
    Subject : Object Oriented Programming Using C++ Class : S.Y. BBA(CA)
    Prof . S. B. Potadar www.dacc.edu.in
    Unit 1 : Introduction to c++
    1. What does a class in C++ holds?
    a) data
    b) functions
    c) both data & functions
    d) arrays
    2. How many specifiers are present in access specifiers in class?
    a) 1
    b) 2
    c) 3
    d) 4
    3. Which is used to define the member of a class externally?
    a) :
    b) ::
    c) #
    d) !!$
    4. Which other keywords are also used to declare the class other than class?
    a) struct
    b) union
    c) object
    d) both struct & union
    5. Which of the following is a valid class declaration?
    a) class A { int x; };
    b) class B { }
    c) public class A { }
    d) object A { int x; };
    6. The data members and functions of a class in C++ are by default ____________
    a) protected
    b) private
    c) public
    d) public & protected
    7. Constructors are used to ____________
    a) initialize the objects
    b) construct the data members
    c) both initialize the objects & construct the data members
    d) delete the objects

    Page 1

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI, PUNE 45
    Subject : Object Oriented Programming Using C++ Class : S.Y. BBA(CA)
    Prof . S. B. Potadar www.dacc.edu.in
    Unit 2 : Tokens, Expressions & Control Structure
    8. When struct is used instead of the keyword class means, what will happen in the program?
    a) access is public by default
    b) access is private by default
    c) access is protected by default
    d) access is denied
    9. Which category of data type a class belongs to?
    a) Fundamental data type
    b) Derived data type
    c) User defined derived data type
    d) Atomic data type
    10. Which operator a pointer object of a class uses to access its data members and member functions?
    a) .
    b) ->
    c) :
    d) ::
    11. How the objects are self-referenced in a member function of that class.
    a) Using a special keyword object
    b) Using this pointer
    c) Using * with the name of that object
    d) By passing self as a parameter in the member function
    12. What does a mutable member of a class mean?
    a) A member that can never be changed
    b) A member that can be updated only if it not a member of constant object
    c) A member that can be updated even if it a member of constant object
    d) A member that is global throughout the class

    Page 2

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI, PUNE 45
    Subject : Object Oriented Programming Using C++ Class : S.Y. BBA(CA)
    Prof . S. B. Potadar www.dacc.edu.in
    Unit 3 : Functions in C++
    13. Pick the incorrect statement about inline functions in C++?
    a) They reduce function call overheads
    b) These functions are inserted/substituted at the point of call
    c) Saves overhead of a return call from a function
    d) They are generally very large and complicated function
    14. Inline functions are avoided when ____________________________
    a) function contains static variables
    b) function have recursive calls
    c) function have loops
    d) all of the mentioned
    15. 10. Pick the correct statement.
    a) Macros and inline functions are same thing
    b) Macros looks like function calls but they are actually not
    c) Inline functions looks like function but they are not
    d) Inline function are always large
    16. Which functions of a class are called inline functions?
    a) All the functions containing declared inside the class
    b) All functions defined inside or with the inline keyword
    c) All the functions accessing static members of the class
    d) All the functions that are defined outside the class
    17. Which keyword is used to define the user defined data types?
    a) def
    b) union
    c) typedef
    d) type
    18. Identify the correct statement.
    a) typedef does not create different types. It only creates synonyms of existing types
    b) typedef create different types
    c) typedef create own types
    d) typedef will not creates synonyms of existing types
    19. What does the data type defined by union will do?
    a) It allow one different portion of memory to be accessed as same data types
    b) It allow one same portion of memory to be accessed as same data types
    c) It allow one different portion of memory to be accessed as different data types
    d) It allow one same portion of memory to be accessed as different data types

    Page 3

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI, PUNE 45
    Subject : Object Oriented Programming Using C++ Class : S.Y. BBA(CA)
    Prof . S. B. Potadar www.dacc.edu.in
    20. What is the syntax of user-defined data types?
    a) typedef ExistingDataType NameByUser
    b) typedef NameByUser ExistingDataType
    c) def NameByUser ExistingDataType
    d) def NameByUser ExistingData
    21. How many types of user-defined data type are in c++?
    a) 1
    b) 2
    c) 3
    d) 4
    22. What is the scope of typedef defined data types?
    a) inside that block only
    b) whole program
    c) outside the program
    d) main function
    23. How many types of models are available to create the user-defined data type?
    a) 1
    b) 2
    c) 3
    d) 4

    Page 4

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI, PUNE 45
    Subject : Object Oriented Programming Using C++ Class : S.Y. BBA(CA)
    Prof . S. B. Potadar www.dacc.edu.in
    Unit 4 : Classes and Objects
    24. Where does the object is created?
    a) class
    b) constructor
    c) destructor
    d) attributes
    25. How to access the object in the class?
    a) scope resolution operator
    b) ternary operator
    c) direct member access operator
    d) resolution operator
    26. Which of these following members are not accessed by using direct member access operator?
    a) public
    b) private
    c) protected
    d) both private & protected
    27. Pick out the other definition of objects.
    a) member of the class
    b) associate of the class
    c) attribute of the class
    d) instance of the class
    28. How many objects can present in a single class?
    a) 1
    b) 2
    c) 3
    d) as many as possible
    29. Which special character is used to mark the end of class?
    a) ;
    b) :
    c) #
    d) $
    30. Pick the other name of operator function.
    a) function overloading
    b) operator overloading
    c) member overloading
    d) object overloading

    Page 5

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI, PUNE 45
    Subject : Object Oriented Programming Using C++ Class : S.Y. BBA(CA)
    Prof . S. B. Potadar www.dacc.edu.in
    31. Which of the following operators can’t be overloaded?
    a) ::
    b) +
    c)
    d) []
    32. How to declare operator function?
    a) operator sign
    b) operator
    c) name of the operator
    d) name of the class
    33. 8. Which of the following statements is NOT valid about operator overloading?
    a) Only existing operators can be overloaded
    b) The overloaded operator must have at least one operand of its class type
    c) The overloaded operators follow the syntax rules of the original operator
    d) None of the mentioned
    34. Operator overloading is ___________
    a) making c++ operator works with objects
    b) giving new meaning to existing operator
    c) making the new operator
    d) adding operation to the existing operators
    35. What is operator overloading in C++?
    a) Overriding the operator meaning by the user defined meaning for user defined data type
    b) Redefining the way operator works for user defined types
    c) Ability to provide the operators with some special meaning for user defined data type
    d) All of the mentioned
    36. What is the syntax of overloading operator + for class A?
    a) A operator+(argument_list){}
    b) A operator[+](argument_list){}
    c) int +(argument_list){}
    d) int [+](argument_list){}
    37. 6. How many approaches are used for operator overloading?
    a) 1
    b) 2
    c) 3
    d) 4
    38. 7. Which of the following operator cannot be overloaded?
    a) +
    b) ?:

    Page 6

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI, PUNE 45
    Subject : Object Oriented Programming Using C++ Class : S.Y. BBA(CA)
    Prof . S. B. Potadar www.dacc.edu.in
    c)
    d) %
    39. Which of the following operator can be overloaded?
    a) ?:
    b) ::
    c) .
    d) ==
    40. Which of the following operator cannot be used to overload when that function is declared as friend
    function?
    a) -=
    b) ||
    c) ==
    d) []
    41. 10. Which of the following operator can be used to overload when that function is declared as friend
    function?
    a) []
    b) ()
    c) ->
    d) |=
    42. In case of non-static member functions how many maximum object arguments a unary operator
    overloaded function can take?
    a) 1
    b) 2
    c) 3
    d) 0
    43. In case of non-static member functions how many maximum object arguments a binary operator
    overloaded function can take?
    a) 1
    b) 2
    c) 3
    d) 0
    44. In the case of friend operator overloaded functions how many maximum object arguments a unary
    operator overloaded function can take?
    a) 1
    b) 2
    c) 3
    d) 0

    Page 7

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI, PUNE 45
    Subject : Object Oriented Programming Using C++ Class : S.Y. BBA(CA)
    Prof . S. B. Potadar www.dacc.edu.in
    45. In the case of friend operator overloaded functions how many maximum object arguments a binary
    operator overloaded function can take?
    a) 1
    b) 2
    c) 3
    d) 0
    46. What is a binary operator?
    a) Operator that performs its action on a single operand
    b) Operator that performs its action on two operand
    c) Operator that performs its action on three operand
    d) Operator that performs its action on any number of operands
    47. Which is the correct example of a binary operator?
    a) ++
    b)
    c) Dereferencing operator(*)
    d) +
    48. Which is the correct example of a unary operator?
    a) &
    b) ==
    c)
    d) /
    49. Which is called ternary operator?
    a) ?:
    b) &&
    c) |||
    d) ===
    50. Which is the correct statement about operator overloading?
    a) Only arithmetic operators can be overloaded
    b) Only non-arithmetic operators can be overloaded
    c) Precedence of operators are changed after overlaoding
    d) Associativity and precedence of operators does not change
    51. Pick the incorrect statements out of the following.
    a) Operator overloading does not disturbs the precedence of operators
    b) Arity of operators can be changed using operator overloading
    c) No new operators can be created
    d) All of the mentioned
    52. Which header file is used to declare the complex number?
    a) complexnum

    Page 8

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI, PUNE 45
    Subject : Object Oriented Programming Using C++ Class : S.Y. BBA(CA)
    Prof . S. B. Potadar www.dacc.edu.in
    b) complex
    c) complex number
    d) complexarg
    53. How to declare the complex number?
    a) (3, 4)
    b) complex(3, 4)
    c) (3, 4i)
    d) (3, 4g)
    54. How many real types are there in complex numbers?
    a) 1
    b) 2
    c) 3
    d) 4
    55. Which of the following is not a function of complex values?
    a) real
    b) imag
    c) norm
    d) Cartesian
    56. What is the return type of the conversion operator?
    a) void
    b) int
    c) float
    d) no return type
    57. Why we use the “dynamic_cast” type conversion?
    a) result of the type conversion is a valid
    b) to be used in low memory
    c) result of the type conversion is an invalid
    d) it is used for storage
    58. Why we use the “dynamic_cast” type conversion?
    a) result of the type conversion is a valid
    b) to be used in low memory
    c) result of the type conversion is an invalid
    d) it is used for storage
    59. How many parameters does a conversion operator may take?
    a) 0
    b) 1
    c) 2
    d) as many as possible

    Page 9

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI, PUNE 45
    Subject : Object Oriented Programming Using C++ Class : S.Y. BBA(CA)
    Prof . S. B. Potadar www.dacc.edu.in
    60. How are types therein user-defined conversion?
    a) 1
    b) 2
    c) 3
    d) 4
    61. Pick out the correct syntax of operator conversion.
    a) operator float()const
    b) operator float()
    c) operator const
    d) operator const()
    62. Which rule will not affect the friend function?
    a) private and protected members of a class cannot be accessed from outside
    b) private and protected member can be accessed anywhere
    c) protected member can be accessed anywhere
    63. Which keyword is used to declare the friend function?
    a) firend
    b) friend
    c) classfriend
    d) myfriend
    64. What is the syntax of friend function?
    a) friend class1 Class2;
    b) friend class;
    c) friend class
    d) friend class()
    65. Pick out the correct statement.
    a) A friend function may be a member of another class
    b) A friend function may not be a member of another class
    c) A friend function may or may not be a member of another class
    d) None of the mentioned
    66. Where does keyword ‘friend’ should be placed?
    a) function declaration
    b) function definition
    c) main function
    d) block function
    67. What is a friend function in C++?
    a) A function which can access all the private, protected and public members of a class
    b) A function which is not allowed to access any member of any class

    Page 10

Download this file to view remaining 25 pages

logo StudyDocs
StudyDocs is a platform where students and educators can share educational resources such as notes, lecture slides, study guides, and practice exams.

Contacts

Links

Resources

© 2025 StudyDocs. All Rights Reserved.