C++ LANGUAGE MULTIPLE CHOICE QUESTION
1. PASCAL, BASIC and C are: Procedural languages Object oriented languages Non-procedural languages None of these www.prolearninghub.com
Non-procedural language 2. C++ is a: Procedural language OO language Non-procedural language None of these www.prolearninghub.com
3. The two major components of an object are: Function and class Function and object Function and data None of these www.prolearninghub.com
4. In C++ a function contained within a class is called: A member function A class An operator An data item www.prolearninghub.com
5. Protecting data from access by unauthorized functions is called: Data hiding Data manipulation Data mining Data integration www.prolearninghub.com
6. Which of the following are good reasons to use an object oriented language? You can define your own data types Program statements are simpler than its procedural language An OO program can taught to correct its own errors It's much diffcult to conceptualize an OO object www.prolearninghub.com
7. ---------- model entities in the real world more closely then do functions? Class object Function System www.prolearninghub.com
8. A C++ program is ----- than a C program except for details of coding: similar different tough None of these www.prolearninghub.com
9. Bundling data and functions together is called: Method declaration Encapsulation Data hiding Program formatting www.prolearninghub.com
10. When a language has the capability to produce new data types: Reprehensible Encapsulated Overloaded Extensible www.prolearninghub.com
11. What does compiler do with white space Consider them Ignore them Print them Ignore the www.prolearninghub.com
12. The ability of a function or operator to act in a different ways in different data types is called: Polymorphism Inheritance Encapsulation None of these www.prolearninghub.com
13. A normal C++ operator that acts in special way in newly defined data types are called as Glorified Encapsulated Classified Overloaded www.prolearninghub.com
14. “Memorizing the new terms used in C++ is” Critically important Something you can return to later The key of wealth and success Completely irrelevant www.prolearninghub.com
15. Dividing a program into functions: Is the key to OO programming Make the program easier to conceptualize May reduce the size of program Make the program run faster www.prolearninghub.com
16. A function name must be followed by: Curley brackets Parentheses Round brackets Square brackets www.prolearninghub.com
17. A function body is delimited by: Braces [] Braces {} Braces () None of these www.prolearninghub.com
18. Why the main function is special: Because program execution starts from main function Because all code reside in main function Because main reserve the memory for program None of mentioned www.prolearninghub.com
19. A C++ instructions that tell a computer to do something is called: Function class Statement Declaration www.prolearninghub.com
20. An expression: Usually evaluates to a numerical value Indicates the emotional state of a program Always occur outside a function May be a part of a statement www.prolearninghub.com
21. Specify how many bytes occupied by int? 3 4 5 www.prolearninghub.com
22. Specify how many bytes occupied by long? 4 6 8 www.prolearninghub.com
23. Specify how many bytes occupied by long double? 4 6 8 10 www.prolearninghub.com
24. A variable of type ---- can hold the value 301. Int Char Long Double www.prolearninghub.com
25. In an assignment statement a value on the left is always equal to the value of the left? Yes No Depend on condition None of these www.prolearninghub.com
26. cout is used for: Print a statement Declare a variable Function declaration None of these www.prolearninghub.com
27. What header must you #include with your source file to use cout and cin? IOSTREAM.H IOSTREAM.M IOSTREAM.G IOSTREAM.P www.prolearninghub.com
28. Write a statement to get a numerical value from the keyboard in a variable temp. Cout << temp; Cout = temp; Cin >> temp; None of this www.prolearninghub.com
Not perfactly but partialy 29. Is it perfectly all right to use variable of different data types in a same arithmetic expression? Yes No Not perfactly but partialy Can't specify www.prolearninghub.com
30. The expression 10 % 3 evaluates to: 2 3 4 5 www.prolearninghub.com
31. An arithmetic assignment operator is combines the effect of two operators: Assignment (=) and arithmetic (like + or *) > and < Logical operator and assignment None of these www.prolearninghub.com
32. In C++ the term “casts” applies to Data conversion Data storing Data manipulating Data hiding www.prolearninghub.com
33. Assuming var1 is starts from 20, what will be following code fragment printout? Count << var1--; Count << ++var1; 2019 1920 2020 2021 www.prolearninghub.com
The arithimatic operator that only work with integer variable is called? Remainder operator Relational operator comparison operator None of these www.prolearninghub.com
32. The increment operator increases the value of a number by------? 1 2 3 4 www.prolearninghub.com
35. A relational operator: (Choose all that apply) Assign one operand to another Yields a Boolean result Compare two operands Logically combine two operands www.prolearninghub.com
37. Name the three expressions in the for loop Initialization, test, increment or decrement Initialization, test, termination Initialization, finalization, termination None of these www.prolearninghub.com
38. In a for loop with multi-statement semicolons should appear following: (Choose all that apply) The for statement itself The closing braces in a multi-statement loop body Each statement is a loop body The test expression www.prolearninghub.com
39. The increment expression in a for loop can decrement the loop variable True False www.prolearninghub.com
40. A block of code is delimited by: Body class functions Braces {} www.prolearninghub.com
41. A variable defined within a block is visible: From the point of definition onward in the program From the point of definition onward in the function From the point of definition onward in the block Throughout in the function www.prolearninghub.com
42. Relational operators have the ------- higher precedence then arithmetic operators. Lower Higher Depend on situation Equal precedence www.prolearninghub.com
43. How many time is the loop body executed in a do loop. One time Two times At least one time Three times www.prolearninghub.com
44. The library function exit () am exit from: In loops in which it occurs The block in which it occurs The function in which it occurs The program in which it occurs www.prolearninghub.com
45. The getche () function returns---- . A character when any key is pressed Returns a character when enter is pressed Display a character when pressed any key Does not display any character on the screen www.prolearninghub.com
46. What is the character obtained when we pressed enter from keyboard? ‘ / ’ www.prolearninghub.com
47. An else is always matches the ----- if, unless the if is surrounded by the braces {}. Preceding Deciding Seceding None of these www.prolearninghub.com
48. The else if construction is obtained from if…. else by -------? Formatting Reformatting Clearing None of these www.prolearninghub.com
49. The && and || operators: Compare two numeric values Combine two numeric values Compare two Boolean values Combine two Boolean values www.prolearninghub.com
50. The break statement causes an exit: Only from the innermost loop Only from the innermost switch From all loops and switches From innermost loop or switch www.prolearninghub.com