Computer Science - Object Oriented Programming using C++
Quiz-summary
0 of 66 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
Information
This is MCQs of Computer Science Subject.
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
0 of 66 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- Answered
- Review
-
Question 1 of 66
1. Question
C++ was originally developed by
Correct
Incorrect
-
Question 2 of 66
2. Question
Cfront
Correct
Incorrect
-
Question 3 of 66
3. Question
The following program fragment
int i = 10:
void main ( )
{
int i=20;
cout << i << ::i; } }Correct
Incorrect
-
Question 4 of 66
4. Question
Which of the following are procedural languages ?
Correct
Incorrect
-
Question 5 of 66
5. Question
A function abc is defined as as
void abc (int x=0, int Y=0)
{ cout << x << Y : ) Which of the following function calls is/are illegal? (Assume h,g are declared as integers)Correct
Incorrect
-
Question 6 of 66
6. Question
The following C++ code results in
#include “iostream.h”
void main (void)
{
cout << (int i=5) << (int j=6); }Correct
Incorrect
-
Question 7 of 66
7. Question
Reusability is a desirable feature of a language as it
Correct
Incorrect
-
Question 8 of 66
8. Question
Choose the correct statements regarding inline functions.
Correct
Incorrect
-
Question 9 of 66
9. Question
If many functions have the same name, which of the following information, if present, will be used by the compiler to invoke the correct function to be used ?
Correct
Incorrect
-
Question 10 of 66
10. Question
The statements
int a = 5
cout << "FIRST" << (a<<2) << "SECOND" ; outputsCorrect
Incorrect
-
Question 11 of 66
11. Question
Choose the correct remarks.
Correct
Incorrect
-
Question 12 of 66
12. Question
A constructor is called whenever
Correct
Incorrect
-
Question 13 of 66
13. Question
Which of the following remarks about the differences between constructors and destructors are correct ?
Correct
Incorrect
-
Question 14 of 66
14. Question
The following program fragment
Void main ( )
{
int x=10 ;
int &p=x ;
cout << %p << &x ; }Correct
Incorrect
-
Question 15 of 66
15. Question
The declaration
int x ; int &p=x;
is same as the declaration
int x, *p; p=&x;
This remark isCorrect
Incorrect
-
Question 16 of 66
16. Question
The following program segment
const int m=10;
int &n=m;
n=11;
cout << m << n ;Correct
Incorrect
-
Question 17 of 66
17. Question
The following program segment
int a=10;
int const &b=a;
a=11;
cout << a << b;Correct
Incorrect
-
Question 18 of 66
18. Question
Which of the following is not a storage class supported by C++?
Correct
Incorrect
-
Question 19 of 66
19. Question
Consider the following program segment.
static char X [3] = “1 2 3 4” ;
cout << x ; A complete C++ program with these two statementsCorrect
Incorrect
-
Question 20 of 66
20. Question
Consider the declarations
const char cc = ‘h’:
char *cp:
const char *const ccpc = &cc;
char *const *cpcp;
Which of the following statements
Statement I: cp = *cpcp;
Statement II: **cpcp = *cp;
Statement III: *cp = **cpcp;
are legal?Correct
Incorrect
-
Question 21 of 66
21. Question
Which of the following operators cannot be overloaded?
Correct
Incorrect
-
Question 22 of 66
22. Question
The declaration B x:
Correct
Incorrect
-
Question 23 of 66
23. Question
If the main function has the two statements
B x ;
cout << " done" ; the output will beCorrect
Incorrect
-
Question 24 of 66
24. Question
Class Dog ; Public X, public Y
is an example ofCorrect
Incorrect
-
Question 25 of 66
25. Question
Choose the correct statements.
Correct
Incorrect
-
Question 26 of 66
26. Question
A function abc is defined as
void abc (int x=o, int Y, int z=0)
{
cout << x << Y << z; } Which of the following function calls is/are illegal? (Assume h, g are declared as integers)Correct
Incorrect
-
Question 27 of 66
27. Question
The compiler identifies a virtual function to be pure
Correct
Incorrect
-
Question 28 of 66
28. Question
Let class APE be a friend of class SAPIEN. Let class HUMAN be a child class of SAPIEN and let MONKEY be a child class of APE. Then
Correct
Incorrect
-
Question 29 of 66
29. Question
A class having no name
Correct
Incorrect
-
Question 30 of 66
30. Question
For a method to be an interface between the outside world and a class, it has to be decland
Correct
Incorrect
-
Question 31 of 66
31. Question
If the function chg is coded as
int chg (int x)
{
x = 10 ;
return (11) ;
}
thenCorrect
Incorrect
-
Question 32 of 66
32. Question
If the function chg is coded as
int chg (int &x)
{
x = 10 ;
return (11) ;
}
thenCorrect
Incorrect
-
Question 33 of 66
33. Question
If the function chg is coded as
int chg (const int &x)
{
x = 10 ;
return (11) ;
}
thenCorrect
Incorrect
-
Question 34 of 66
34. Question
Choose the correct statements from the following.
Correct
Incorrect
-
Question 35 of 66
35. Question
Overloading is otherwise called as
Correct
Incorrect
-
Question 36 of 66
36. Question
Consider the following program segment.
const char *p1 = “To make the bitter butter better “; // stm1
char *const p2 = “Recommend this book 2 others “‘//stm2
p1 = “add some better butter not botter.” ; //stm3
p2 = “so that they 2 will get benefited. ” ; //stm4
*(p1+3) = ‘A’ ; //stm5
*(p2+3) = ‘A’ ; //stm6
Which of the statement results in error?Correct
Incorrect
-
Question 37 of 66
37. Question
C++ encourages structuring a software as a collection of components that are
Correct
Incorrect
-
Question 38 of 66
38. Question
Which of the following parameter passing mechanism(s) is/are supported by C++, but not by C?
Correct
Incorrect
-
Question 39 of 66
39. Question
cout stands for
Correct
Incorrect
-
Question 40 of 66
40. Question
The following program
void abc (int &p)
{ cout << p; } void main (void) { float m = 1.23; abc (m) ; cout << m; }Correct
Incorrect
-
Question 41 of 66
41. Question
Reference is not same as pointer because
Correct
Incorrect
-
Question 42 of 66
42. Question
If piece of code can be implemented as a macro as an inline function, which of the following factors favour implementation as an inline function ?
Correct
Incorrect
-
Question 43 of 66
43. Question
The fields in a structure of a C program are by default
Correct
Incorrect
-
Question 44 of 66
44. Question
The fields in a class, of a C++ program are by default
Correct
Incorrect
-
Question 45 of 66
45. Question
If the function main is coded as
mho a,b;
the output will beCorrect
Incorrect
-
Question 46 of 66
46. Question
If the function main, is coded as
mho a; a=a-a;
the output will beCorrect
Incorrect
-
Question 47 of 66
47. Question
If the declaration
mho operator – (mho y) ;
is replaced by
mho operator – (mho &y) ;
the output will beCorrect
Incorrect
-
Question 48 of 66
48. Question
The variable i 2 is accessible
Correct
Incorrect
-
Question 49 of 66
49. Question
Which variable(s) is/are accessible from the main function?
Correct
Incorrect
-
Question 50 of 66
50. Question
The following program
class abc;
class def
{ int il; //statement 1
protected; int i2; // statement 2
public: int i3; // statement 3
friend abc;
};
class abc
{ public:
void main(def A)
{cout << (A.il=3); cout << (A.i2=4); cout << (A.i3=5) } } ; void main ( ) { def x1 ; abc x2 ; x2.mn (x1) ; }Correct
Incorrect
-
Question 51 of 66
51. Question
The above program
Correct
Incorrect
-
Question 52 of 66
52. Question
If the statement
q += b(a(q)); is replaced by the statement
q += b(a(p)); then the above programCorrect
Incorrect
-
Question 53 of 66
53. Question
consider the declarations
char a;
const char aa= ‘h’;
char *na;
const char *nas:
Which of the following statements
Statement I: aa = a;
Statement II: na = &a:
Statement III: na = &aa:
is/are illegal?Correct
Incorrect
-
Question 54 of 66
54. Question
Forgetting to include a file (like cmath or math.h)that is necessary will result in
Correct
Incorrect
-
Question 55 of 66
55. Question
Assume that the random number generating function – rand ( ). returns an integer between 0 and 10000 (both inclusive). If you want to simulate the throwing of a die using this random function, use the expression
Correct
Incorrect
-
Question 56 of 66
56. Question
Assume that the random number generating function – rand ( ), returns an integer between 0 and 10C 00 (both inclusive). To randomly generate a number between a and b (both inclusive) use the expression
Correct
Incorrect
-
Question 57 of 66
57. Question
Which of the following comments about inline comments are true?
Correct
Incorrect
-
Question 58 of 66
58. Question
Which of the following decides if a functions that is declared inline is indeed going to be treated inline in the executabel code?
Correct
Incorrect
-
Question 59 of 66
59. Question
Which of the following type of functions is an ideal candidate for being declared inline?
Correct
Incorrect
-
Question 60 of 66
60. Question
One of the disadvantages of pass-by reference is that the called function may inadvertently corrupt the caller’s date. This can be avoided by
Correct
Incorrect
-
Question 61 of 66
61. Question
What is the output of the following C++ program?
void abc(int x = 0, int y = 0)
{cout << "Hi There";} void abc(int x) { cout << "How R U doing today?";) void main (void) { int m = 5; abc(m); }Correct
Incorrect
-
Question 62 of 66
62. Question
Choose the best answer.
A function that does the same operation on different data types is to be implemented usingCorrect
Incorrect
-
Question 63 of 66
63. Question
At what point of time a variable comes into existence in memory is determined by its
Correct
Incorrect
-
Question 64 of 66
64. Question
Which of the following specifiers need not be honored by the compiler?
Correct
Incorrect
-
Question 65 of 66
65. Question
Which of the following cannot be declared static?
Correct
Incorrect
-
Question 66 of 66
66. Question
The order in which operands are evaluated in an expression is predictable if the operator is
Correct
Incorrect