Documente Academic
Documente Profesional
Documente Cultură
MC0066
OOPS USING C++/ADVANCE CONCEPTS OF OOPS USING C++
(1-MARK questions) 1. Real constant can be represented in 2 forms: a. b. c. d. Decimal form, exponential form Integer, decimal form Exponential form , integer Decimal form, real form
2. Integer values lie between a. 30657,31658 b. 32768, 32767 c. 31757,31758 d. 32568,32768 3. The % operator gives the a. Quotient b. Remainder c. None d. Both 4. The output of the following a>b? a : b+10; If A=10, b=5 a. 10 b. 15 c. 5 d. none of the above 5. A character variable can at ime store a. 1 character b. 8 character c. 254 character d. none of the above 6. If a is an integer variable , a=5/2; will return a value a. 2.5 b. 3 c. 2 d. 0 7. The expression , a=7/22*(3.14+2)*3/5; evaluates to a. 8.28 b. 6.288 PC Training Institute Ltd., An ISO-9001 Certified Organisation 1
32. Unary operators overloaded for the class can differentiate between post and pre operators. False 33. Static data member of a class can be modified by all objects of the class. True 34. Array of structure can be created. 35. Structure variables cantbe initialized during declaration. True False
36. If the function does not have any return value, the return statement can be skipped. True 37. char str[]; is a valid statement. False
38. In array every data should be separated by comma and all elements enclosed within flower bracket while initializing during declaration. True 39. The static variables of the class have to be explicitly initialized outside the class name followed by scope resolution operator (: : ) and static variable name True 40. Static data need not be initialized. False
(2-MARKS questions)
41. The ________ is used to access the public members of the class with a ________ of an object ({arrow}, Pointer) 42. The operator ______ When placed before a variable, returns the memory address of its operand and the ____________ returns the data value stored in the area being pointed to by the pointer following it (&, *) 43. When amount of memory is predicated and the memory is allocated during compiletime (When the program is being compiled, it is referred to as _______ But when amount of memory to be allocated is not prebnown, and the memory is allocated during runtime (when the program is running as when required, it is referred to as) _________ (Static memory allocation, dynamic memory allocation) 44. The process of invoking a function through its own body is known ______ (Recession) 45. The variables or values passed to a function are called __________ or ______ (Actual parameters, arguments) PC Training Institute Ltd., An ISO-9001 Certified Organisation 5
59. What output does the above code fragment produce? Int ch =20; Cout <<ch <<++ch<<ch, Ans a. 21 b. 20
PC Training Institute Ltd., An ISO-9001 Certified Organisation
21 20
20 21
Hint Because when multiple values are cascaded without, calculations tabe place from right-to-left but printing tabe place from left-to-right. 60. Name the header file to be included for the use of following built-in- functions: a. Isupperc b. Gets c. Strlen d. Log () (a. Ctype.h b. stdio.h c. string.h d. math.h)
(4-MARKS questions)
61. Inheritance has many forms as : 1. 2. 3. 4. 5. Single inheritance multiple inheritance Hierarchical inheritance Multilevel inheritance Hybrid inheritance a) ALL b) Only 1 ,2 and 3 c) Only 1, 3 and 5 d) Only 1, 3 and 4
62. i. Global variable last for the duration of program execution. ii. Local variables are created when their scope is entered and destroyed when their scope is exited. a. Both i and ii are true b. Only i is true c. Both i and ii are false d. Only ii is true 63. i. The memory space for global variables is reserved prior to program execution ii. The memory space for local variables is allocated on the fly during program execution. a. Both are false We touch the future we teach ! b. i is false ii is true c. i is true ii is false
10
b)
c)
d)
74. The output of following will be void main() { int b = 2 ; switch (b) { case 1: cout<<"one"; case 2: cout<<"two"; case 3: cout<<"three"; default :cout<<"invalid"; } } a. two b. two three invalid c. erro r d. invalid 75. The output of following will be void main() { int y , x = 12 ; We touch the future we teach ! y = ++x ; cout<<y; cout<< x;
11
12
13