C++ Programming Test By Kishor Raut - August 21, 2021 FacebookTwitterPinterestWhatsApp Welcome to your C++ Programming Test 1. To hide a data member from the program, you must declare the data member in the _______ section of the class.A. ProtectedB. ConfidentialC. HiddenD. PrivateE. Restricted. 2. What is the Output of this Program? #include using namespace std; class sample { private: int a, b; public: void test() { a = 100; b = 200; } friend int compute(sample e1); }; int compute(sample e1) { return int(e1.a + e1.b) - 5; } int main() { sample e; e.test(); cout<<compute(e); return 0; }A. 295B. 100C. 300D. 200E. None 3. The function whose prototype is void getData(Item *thing); receives ________ .A. A pointer to a structure.B. A reference to a structure.C. A copy of a structure.D. Nothing 4. Null character needs a space of _______ .A. Zero bytes.B. One byte.C. Three bytes.D. Four bytes. 5. The number of structures that can be declared in a single statement is _______ ?A. OneB. TwoC. ThreeD. Unlimited 6. Which of the following formulas can be used to generate random integers between 1 and 10?A. 1 + rand() % (10 - 1 + 1).B. 1 + (10 - 1 + 1) % rand().C. 10 + rand() % (10 - 1 + 1).D. 10 + rand() % (10 + 1). 7. Format flags may be combined using the _______.A. Bitwise OR operator ( | )B. Logical OR operator ( || )C. Bitwise AND operator (& )D. Logical AND operator ( && ) 8. Which of the following will store the number 320000 as a Float number?A. CounPop = (float) 3.2e5;B. CounPop = (float) 3.2e6;C. CounPop = (float) .32e5;D. CounPop = (float) .32e7; 9. Which other keywords are also used to declare the class other than class?A. structB. unionC.objectD. both (a) and (b) 10. The following statement where T is true and F is false,T && T || F && T _______ .A. is trueB. is falseC. is wrongD. Not applicable in C language 11. Which of the following statements declare a variable that can contain a decimal number?A. Dec payRate;B. Decimal hourlyPayC. Integer payRateD. Float hourlyPay; 12. The statement int num[2][3]={ {1,2}, {3,4}, {5, 6} }; ________ .A. assigns value 2 to num[1][2]B. assigns value 4 to num[1][2]C. Gives an error messageD. assigns value 3 to num[1][2] 13. The standard input stream, which refers to the keyboard, is called _______?A. cinB. coutC. stinD. stout 14. Elements in an array are identified by a unique _______ .A. Data type.B. OrderC. SubscriptD. Symbol 15. The statement fwrite( (char*)&objl, sizeof(objl) ); ________ .A. Writes the member functions of objl to fl.B. Writes the data in objl to fl.C. Writes the member functions and data of obj1 to fl.D. Writes the address of objl to fl. Time is Up!