Download presentation
Presentation is loading. Please wait.
1
C++ LANGUAGE MULTIPLE CHOICE QUESTION
2
1. PASCAL, BASIC and C are: Procedural languages
Object oriented languages Non-procedural languages None of these
3
Non-procedural language
2. C++ is a: Procedural language OO language Non-procedural language None of these
4
3. The two major components of an object are:
Function and class Function and object Function and data None of these
5
4. In C++ a function contained within a class is called:
A member function A class An operator An data item
6
5. Protecting data from access by unauthorized functions is called:
Data hiding Data manipulation Data mining Data integration
7
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
8
7. ---------- model entities in the real world more closely then do functions?
Class object Function System
9
8. A C++ program is ----- than a C program except for details of coding:
similar different tough None of these
10
9. Bundling data and functions together is called:
Method declaration Encapsulation Data hiding Program formatting
11
10. When a language has the capability to produce new data types:
Reprehensible Encapsulated Overloaded Extensible
12
11. What does compiler do with white space
Consider them Ignore them Print them Ignore the
13
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
14
13. A normal C++ operator that acts in special way in newly defined data types are called as
Glorified Encapsulated Classified Overloaded
15
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
16
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
17
16. A function name must be followed by:
Curley brackets Parentheses Round brackets Square brackets
18
17. A function body is delimited by:
Braces [] Braces {} Braces () None of these
19
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
20
19. A C++ instructions that tell a computer to do something is called:
Function class Statement Declaration
21
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
22
21. Specify how many bytes occupied by int?
3 4 5
23
22. Specify how many bytes occupied by long?
4 6 8
24
23. Specify how many bytes occupied by long double?
4 6 8 10
25
24. A variable of type ---- can hold the value 301.
Int Char Long Double
26
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
27
26. cout is used for: Print a statement Declare a variable
Function declaration None of these
28
27. What header must you #include with your source file to use cout and cin?
IOSTREAM.H IOSTREAM.M IOSTREAM.G IOSTREAM.P
29
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
30
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
31
30. The expression 10 % 3 evaluates to:
2 3 4 5
32
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
33
32. In C++ the term “casts” applies to
Data conversion Data storing Data manipulating Data hiding
34
33. Assuming var1 is starts from 20, what will be following code fragment printout? Count << var1--; Count << ++var1; 2019 1920 2020 2021
35
The arithimatic operator that only work with integer variable is called?
Remainder operator Relational operator comparison operator None of these
36
32. The increment operator increases the value of a number by------?
1 2 3 4
37
35. A relational operator: (Choose all that apply)
Assign one operand to another Yields a Boolean result Compare two operands Logically combine two operands
38
37. Name the three expressions in the for loop
Initialization, test, increment or decrement Initialization, test, termination Initialization, finalization, termination None of these
39
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
40
39. The increment expression in a for loop can decrement the loop variable
True False
41
40. A block of code is delimited by:
Body class functions Braces {}
42
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
43
42. Relational operators have the ------- higher precedence then arithmetic operators.
Lower Higher Depend on situation Equal precedence
44
43. How many time is the loop body executed in a do loop.
One time Two times At least one time Three times
45
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
46
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
47
46. What is the character obtained when we pressed enter from keyboard?
‘ / ’
48
47. An else is always matches the ----- if, unless the if is surrounded by the braces {}.
Preceding Deciding Seceding None of these
49
48. The else if construction is obtained from if…. else by -------?
Formatting Reformatting Clearing None of these
50
49. The && and || operators:
Compare two numeric values Combine two numeric values Compare two Boolean values Combine two Boolean values
51
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.