C++ Programming Test By Kishor Raut - August 21, 2021 FacebookTwitterPinterestWhatsApp Welcome to your C++ Programming Test 1. Reusability is a desirable feature of a language as it __________.A. decreases the testing timeB. lowers the maintenance costC. reduces the compilation timeD. reduces the execution time 2. Choose the correct statements regarding inline functions.A. They speed up executionB. They slow down executionC. They increase the code sizeD. They decrease the code size 3. If many functions have the same name, which of the following information, if present, will be used by the compiler to invoke the correct function to be used?A. The operator ::B. The return value of the functionC. Function signatureD.None of the above 4. The below statement outputs __________? int a = 5; cout << "FIRST" << (a<<2) << "SECOND";A. FIRST52SECONDB. FIRST20SECONDC. SECOND25FIRSTD. An Error Message 5. Choose the correct remarks.A. C++ allows any operator to be overloaded.B. Some of the existing operators cannot be overloaded.C. Operator precedence cannot be changedD. All of the above 6. A constructor is called whenever __________.A. an object is declaredB. an object is usedC. a class is declaredD. a class is used 7. Which of the following remarks about the differences between constructors and destructors are correct?A. Constructors can take arguments but destructors cannot.B. Constructors can be overloaded but destructors cannot be overloaded.C. Destructors can take arguments but constructors cannot.D.Destructors can be overloaded but constructors cannot be overloaded. 8. The following program fragment __________. #include using namespace std; int main() { int x = 10; int &p = x; cout<< &p<< &x; return 0; }A. prints 10 and the address of xB. results in a runtime errorC. prints the address of x twiceD.prints the address of p twice 9. The declaration int x; int &p=x; is same as the declaration int x, *p; p=&x;. This remark is?A. trueB. falseC. sometimes trueD. none of above 10. The following program segment __________. const int m=10; int &n=m; n=11; cout << m << n;A. results in compile time errorB. results in run time errorC. prints 1111D. prints 1011 11. The following program segment __________. int a = 10; int const &b = a; a = 11; cout << a << b;A. results in compile time errorB. results in run time errorC. prints 1111D. none of the above 12. Which of the following is not a storage class supported by C++?A. registerB. autoC. mutableD. dynamic 13. Consider the following program segment. A complete C++ program with these two statements will __________. static char X[3] = "1234"; cout << X;A. print 1234B. print 123C. print 1234 followed by some junkD. will give a compilation error 14. For the declarations 1,2 and 3, which of the Statements is correct. const char cc = 'h'; Declaration 1: char *cp; Declaration 2: const char *const ccpc = &cc; Declaration 3: char *const *cpcp; Which of the following statements are legal? Statement 1: cp = *cpcp; Statement 2: **cpcp = *cp; Statement 3: *cp = **cpcp;A. All are legalB. All are illegalC. Only statement 1 is illegalD. Statement 1 and 3 are illegal 15. Which of the following operators cannot be overloaded?A. >>B. ?:C. .D. No such operator exists Time is Up!