Programming C++ - Basic concept of C++ MCQ
Programming C++ -Concept of C++ language || Data types || Identifiers || Binary operator| | and all types of question || Related Important MCQs Questions || For GATE, UGC NET, PSU EXAMS, ISRO, BARC, DSSSB TGT, CET PGT, DMRC METRO, UPTET TGT PGT, etc
Q1.An array can store
[ VVIQ]
(A).same types of elements
(B).char and it type
(C).only char types
(D).All of the above
Q2.Which of the following can be considered as the object of an array?
[ VVIQ]
(A).Index of an array
(B).Elements of the array
(C).Functions of the array
(D).All of the above
Q3.Which one of the following can not be used with the virtual keyword?
[ VVIQ]
(A).constructor
(B).destructor
(C).member function
(D).None of these
Q4.Which of the following statements is not true about C++?
[ VVIQ]
(A).Members of a class are public by default
(B).A class can not have the private members
(C).A structure can have the member functions
(D).All of the above
Q5.Which of the following statements is correct about the friend function in C++ programming language?
[ VVIQ]
(A).A friend function is able to access private members of a class
(B).A friend function can access the private members of a class
(C).A friend function is able to access the public members of a class
(D).All of the above
Q6.Which of the following statements is correct about the friend function in C++ programming language?
[ VVIQ]
(A).A friend function is able to access private members of a class
(B).A friend function can access the private members of a class
(C).A friend function is able to access the public members of a class
(D).All of the above
Q7.Which of the following can be used to create an abstract class in the C++ programming language?
[ VVIQ]
(A).By using the pure virtual function in the class
(B).By declaring a virtual function in the base class
(C).By declaring the virtual keyword after word, the class declaration
(D).None of these
Q8.Which of the following is used for implementing the late binding?
[ VVIQ]
(A).operator functions
(B).constant functions
(C).Virtual functions
(D).Both option A & B
Q9.What will happen if " In a C++ program a class has no name"?
[ VVIQ]
(A).It is not even allowed in C++
(B).It will not have the constructor
(C).It will not have the destructor
(D).Both option A & C
Q10.Which of the following statement is correct about the C++ programming language?
[ VVIQ]
(A).In C++, both the static and dynamic type checking are allowed
(B).In C++, member function are allowed to be of the type cast
(C).In C++, dynamic checking is allowed
(D).None of these
Q11.Which of the following can be considered as the members that can be inherited but not accessible in any class?
[ VVIQ]
(A).pubblic
(B).protected
(C).private
(D).Both option A & C
Q12.How many types of the array are there in the C++ Programming language?
[ VVIQ]
(A).Four
(B).Three
(C).Two
(D).Five
Q13.C++ is a type of language
[ VVIQ]
(A).High-level language
(B).Low-level language
(C).Middle-level language
(D).None of these
Q14.Which of the following comment syntax is correct to create a single-line comment in the C++ program?
[ VVIQ]
(A).//comment
(B)./comment/
(C).comment//
(D).None of these
Q15.Which one of the following represents the tab?
[ VVIQ]
(A).
(B).
(C).
(D).None of these
Q16.Which of the following features must be supported by any programming language to become a pure object-oriented programming language?
[ VVIQ]
(A).Encapsulation
(B).Inheritance
(C).Polymerphism
(D).All of the above
Q17.Under which pillar of oops do base class and derived class relationships come?
[ VVIQ]
(A).Polymorphism
(B).Inheritance
(C).Encapsulation
(D).Abstraction
Q18.Data members and member functions of a class are private by default true or false?
[ VVIQ]
(A).true
(B).false
(C).depends on code
(D).None of these
Q19.Types of errors in C++
[ VVIQ]
(A).syntax errors
(B).runtime errors
(C).logic error
(D).All of the above
Q20.Choose the option below which is not a member of the class
[ VVIQ]
(A).Friend function
(B).Static function
(C).Virtual function
(D).Const function
Q21.The total types of constructors in C++ are?
[ VVIQ]
(A).5
(B).2
(C).3
(D).4
Q22.What is the number of parameters that a default constructor requires?
[ VVIQ]
(A).0
(B).1
(C).2
(D).3
Q23.Identify the logical AND operator
[ VVIQ]
(A).||
(B).&&
(C).&
(D).!
Q24.Identify the correct range of unsigned char
[ VVIQ]
(A).-256 to 255
(B).-128 to 127
(C).0 to 255
(D).0 to 127
Q25.Exit control loop is also known as
[ VVIQ]
(A).for loop
(B).while loop
(C).do while loop
(D).None of these
Q26.How much bytes of memory does void occupy?
[ VVIQ]
(A).4
(B).8
(C).0
(D).1
Q27.What is the size of the given below struct?
struct{
int x;
float y;
char z;
int a;
}
[ VVIQ]
(A).9
(B).7
(C).16
(D).32
Q28.Which of the following keywords are used to generate an exception in C++?
[ VVIQ]
(A).threw
(B).throws
(C).throw
(D).catch
Q29.Choose the correct option which is mandatory in a function
[ VVIQ]
(A).return-type
(B).parameters
(C).function-name
(D).Both option A & C
Q30.Using which of the following data type can 39.55 be represented?
[ VVIQ]
(A).void
(B).double
(C).int
(D).char
Q31.Identify the correct default return value of a function
[ VVIQ]
(A).int
(B).double
(C).string
(D).char
Q32.Which of the following are used to denote the "Scope resolution operator"?
[ VVIQ]
(A).:
(B).::
(C).?
(D).?:
Q33.Which of the following loops are used best when we know the number of iterations?
[ VVIQ]
(A).for loop
(B).while loop
(C).Do while loop
(D).All of the above
Q34.Identify the correct example for a post-increment operator
[ VVIQ]
(A).++a
(B).a++
(C).a--
(D).--a
Q35.Which of the following given is a represent address of the operator?
[ VVIQ]
(A).*
(B).#
(C).&
(D).&&
Q36.Identify the correct syntax for declaring arrays in C++?
[ VVIQ]
(A).array arr[20]
(B).arr 20
(C).int arr[20]
(D).int array
Q37.Which of the following data type is supported in C++ but not in C?
[ VVIQ]
(A).int
(B).bool
(C).double
(D).float
Q38.By which of the following can the if-else statement be replaced?
[ VVIQ]
(A).Bitwise operator
(B).Logical operator
(C).Conditional operator
(D).Arithmetic operator
Q39.Identify the type of constructor in C++?
[ VVIQ]
(A).Default constructor
(B).Copy constructor
(C).Parameterized constructor
(D).All of the above
Q40.C++ uses which approach?
[ VVIQ]
(A).Top-down
(B).left-right
(C).Bottom-up
(D).right-left
Next.1
Next.2