Q1. C++ is a AOnly procedural languageBObject-oriented programming languageCOnly markup languageDAssembly language Show answer Answer: B. Object-oriented programming language Report a mistake
Q2. A computer program is AOnly outputBOnly dataCA set of instructions given to a computerDOnly hardware Show answer Answer: C. A set of instructions given to a computer Report a mistake
Q3. Header files in C++ are included using A#headerB#importC#includeD#define Show answer Answer: C. #include Report a mistake
Q4. Reserved words (keywords) in C++ AAre optionalBCan be used freelyCAre only for commentsDCannot be used as variable names Show answer Answer: D. Cannot be used as variable names Report a mistake
Q5. The statement terminator in C++ is AColon ( : )BSemicolon ( ; )CComma ( , )DPeriod ( . ) Show answer Answer: B. Semicolon ( ; ) Report a mistake
Q6. Comments in C++ can be written using A// and /* */BOnly #COnly **DOnly -- Show answer Answer: A. // and /* */ Report a mistake
Q7. A constant in C++ has AFixed value that cannot be changedBNo valueCValue that can be changedDOnly integer value Show answer Answer: A. Fixed value that cannot be changed Report a mistake
Q8. A variable is AA fixed valueBA function onlyCA keywordDA named memory location that can hold a value Show answer Answer: D. A named memory location that can hold a value Report a mistake
Q9. Rules for naming variables include ACan start with digitBCan be keywordsCMust begin with letter or underscoreDCan contain spaces Show answer Answer: C. Must begin with letter or underscore Report a mistake
Q10. Basic data types in C++ include AOnly arrayBOnly stringCint, float, char, double, boolDOnly int Show answer Answer: C. int, float, char, double, bool Report a mistake
Q11. The const qualifier is used to ADeclare a functionBDeclare a classCDeclare a variableDDeclare a constant Show answer Answer: D. Declare a constant Report a mistake
Q12. Type casting is AIncluding header filesBDeclaring a variableCConverting one data type into anotherDWriting comments Show answer Answer: C. Converting one data type into another Report a mistake
Q13. The extension of a C++ source file is usually A.javaB.pyC.cppD.c Show answer Answer: C. .cpp Report a mistake
Q14. The main() function is AOptionalBA header fileCThe entry point of a C++ programDOnly for classes Show answer Answer: C. The entry point of a C++ program Report a mistake
Q15. cout is used for ABothBNoneCStandard outputDStandard input Show answer Answer: C. Standard output Report a mistake
Q16. cin is used for ABothBNoneCStandard outputDStandard input Show answer Answer: D. Standard input Report a mistake
Q19. endl is used to AInclude a fileBInsert a new line and flush the bufferCEnd the programDDeclare a variable Show answer Answer: B. Insert a new line and flush the buffer Report a mistake
Q20. Escape sequences start with AHash ( # )BBackslash ( \ )CAsterisk ( * )DForward slash ( / ) Show answer Answer: B. Backslash ( \ ) Report a mistake
Q22. \t represents ANew lineBCarriage returnCAlertDHorizontal tab Show answer Answer: D. Horizontal tab Report a mistake
Q23. getch() function is used to AClear screenBRead a single character without echoCPause onlyDPrint a character Show answer Answer: B. Read a single character without echo Report a mistake
Q24. clrscr() is used to AClear variablesBClose fileCNoneDClear the screen Show answer Answer: D. Clear the screen Report a mistake
Q25. setw manipulator is used for ASetting precisionBSetting field widthCNoneDSetting fill character Show answer Answer: B. Setting field width Report a mistake
Q26. Operators in C++ are classified as AUnary, Binary, TernaryBOnly ternaryCOnly unaryDOnly binary Show answer Answer: A. Unary, Binary, Ternary Report a mistake
Q27. Unary operators work on ATwo operandsBNoneCOne operandDThree operands Show answer Answer: C. One operand Report a mistake
Q28. Binary operators work on ATwo operandsBOne operandCNoneDThree operands Show answer Answer: A. Two operands Report a mistake
Q30. Arithmetic operators include AOnly + and –B+, –, *, /, %COnly * and /DOnly % Show answer Answer: B. +, –, *, /, % Report a mistake
Q31. Relational operators include A>, <, >=, <=, ==, !=BOnly &&COnly ||DOnly == Show answer Answer: A. >, <, >=, <=, ==, != Report a mistake
Q32. Logical operators include AOnly ==BOnly *COnly +D&&, ||, ! Show answer Answer: D. &&, ||, ! Report a mistake
Q36. Precedence of operators determines AOnly data typeBOnly variable nameCOrder of evaluationDNone Show answer Answer: C. Order of evaluation Report a mistake
Q37. Associativity of operators can be AOnly right to leftBNoneCLeft to right or Right to leftDOnly left to right Show answer Answer: C. Left to right or Right to left Report a mistake
Q38. An expression is AOnly a constantBA combination of operators and operandsCOnly a variableDOnly a function Show answer Answer: B. A combination of operators and operands Report a mistake
Q39. int data type typically occupies A1 byteB16 bytesC2 or 4 bytesD8 bytes Show answer Answer: C. 2 or 4 bytes Report a mistake
Q40. float data type is used for AIntegers onlyBSingle-precision floating point numbersCCharacters onlyDBoolean only Show answer Answer: B. Single-precision floating point numbers Report a mistake
Q41. double data type provides ASingle precisionBDouble-precision floating pointCCharacter onlyDInteger only Show answer Answer: B. Double-precision floating point Report a mistake
Q42. char data type occupies A4 bytesB8 bytesC1 byteD2 bytes Show answer Answer: C. 1 byte Report a mistake
Q43. bool data type can hold AOnly charactersBOnly integersCtrue or falseDOnly floats Show answer Answer: C. true or false Report a mistake
Q44. The sizeof operator returns AType of variableBSize in bytes of a data type or variableCAddress of variableDValue of variable Show answer Answer: B. Size in bytes of a data type or variable Report a mistake
Q45. Implicit type conversion is also called AType promotion / CoercionBNoneCManual conversionDExplicit casting Show answer Answer: A. Type promotion / Coercion Report a mistake
Q46. Explicit type conversion is done using ANoneBOnly assignmentCCast operatorDOnly operators Show answer Answer: C. Cast operator Report a mistake
Q48. A namespace is used to AIncrease speedBNoneCAvoid name conflictsDDecrease memory Show answer Answer: C. Avoid name conflicts Report a mistake
Q49. The standard namespace in C++ is AcppBstandardCmainDstd Show answer Answer: D. std Report a mistake
Q50. using namespace std; allows AFaster executionBNoneCLess memoryDUse of cout, cin without std:: prefix Show answer Answer: D. Use of cout, cin without std:: prefix Report a mistake