CPP Quiz 3
Question 1: ___________ is not a type of scope in c++.
Question 2: Which of the following is the correct operator to compare two variables?
Question 3: Variables that are declared inside a function are called as ______.
Question 4: Most of the statement in C++ program should end with ______.
(A) a full stop (.)
(B) `a comma (,)
(C) a semicolon (;)
(D) a colon (:)
Question 5: __________ is a newline character in c++.
Question 6: If and the switch statements are called as _____ statements.
Question 7: The switch expression must be of type _______ or _______.
(A) char, float
(B) float, int
(C) int, char
(D) har, float
Question 8: Find out the error in following block of code. if (x=100) cout<<“x is 100”;
(A) 100 should be enclosed in quotations
(B) There is no semicolon at the end of first line
(C) Equals to operator mistake
(D) Variable x should not be inside quotation
Question 9: Looping in a program means _____.
(A) jumping to the specified branch of program.
(B) repeat the specified lines of code
(C) execute only once
(D) jump to random location of the program
Question 10: If the type specifier of parameters of a function is followed by an ampersand (&), that function call is _______.
(A) pass by value
(B) pass by reference
(C) array of structures
(D) array of structures. pointers
Question 11: getline() and write() are _________ oriented functions.
Question 12: The general form, of assignment operator is _____.
Question 13: Overloaded functions are ______.
(A) very long functions that can hardly run
(B) two or more functions with the same name but different number of parameters or type
(C) short functions that can easily modified
(D) one function containing another one or more functions inside it
Question 14: ________ function is a function in which expansion of the function takes place rather than execution.
Question 15: The name of a function variable or class is called ________.
Question 16: >> is called as __________ operator.
(C) greater than
(D) lesser than
Question 17: << is called as _______________ operator.
(C) greater than
(D) esser than
Question 18: Arguments of functions are separated with ________.
(A) comma (,)
(B) semicolon (;)
(C) colon (:)
Question 19: _____________ is a variable preserves its value between function calls.
Question 20: ________ supports simultaneous input and output operations on file.
Question 21: ________ is a default access specifier for members of class in C++.
Question 22: A Class can have how many destructor?
Question 23: The parameter list in function overloading must differ by?
(A) Number of functions
(B) Function Size
(C) Function Name
(D) Number of argument
Question 24: Data members is also called?
Question 25: In how many ways is polymorphism achived in C++?
Question 26: A __________ is a special method used to initialize the instance variable of a class.
(A) Member function
Question 27: The ______ keyword brings the members of a namespace into view.
Question 28: If class A inherits from class B, then B is called _______ of A. A is called ________ of B.
(A) Super class, Sub class
(B) Subclass, Super class
(C) Abstract class, Base Class
(D) Child class, Sub Class
Question 29: ________ is the mechanism which allows a class A to inherit properties of a class B.
(A) Data abstraction
Question 30: The mechanism that binds code and data together and keeps them secure from outside world is known as _______________.
Question 31: To overload an operator_________________ keyword must be used along with the operator to be overloaded.
Question 32: Which of the following is not a keyword?
Question 33: The expression 5/2 in c++ is evaluated to ____________.
Question 34: The result of the expression 15%3 in c++ is ___________.
Question 35: An ____________ is a collection of elements of same data type.
Question 36: ______________ operator has the lowest priority.
Question 37: ___________ variables can be initialized only once.
Question 38: Static variables can be ______________.
(A) cannot be created
(B) initialized only once.
(C) a constant
(D) a class
Question 39: Which of the following is true?
(A) presents the standard output stream in c++.
(B) cout declare in the conio standard file.
(C) cout is declared as constants.
(D) cout does nothing in C++ program.
Question 40: What is the syntax of friend function?
(A) friend class1 Class2;
(B) friend class;
(C) friend class