MSC Computer Science Final
MSC Computer Science Final
(FINAL)
1. #define is a
(A) Primary
(B) User-defined
(C) Derived
(D) Console
4. The keyword that is used to transfer control from a function back to the calling
function is
(A) switch
(B) goto
(C) go back
(D) return
(A) union
(B) bit fields
(C) malloc
(D) calloc
6. What is the output of the following C code?
#include <stdio.h>
struct student
{
char *c;
};
void main()
{
struct student s[2];
printf("%d", sizeof(s));
}
(A) 2
(B) 4
(C) 16
(D) 8
#include<stdio.h>
int main()
{
int x=5;
if(5)
{
if(sizeof('\0'))
printf("inside if block");
else
printf("inside else block");
}
return 0;
}
(A) / + * -
(B) - / +
(C) + - / *
(D) / * + -
9. What is the full form of STL?
(A) 0000
(B) 4 8 12 16
(C) 0 16 12 8
(D) 16 12 8 4
(A) Decode
(B) code
(C) ode
(D) Error
(A) The value of variable ‘y’ is assigned to variable ‘x’ but if variable ‘y’ changes
later, it will not change the value of variable ‘x’
(B) The value of variable ‘x’ is assigned to variable ‘y’ but if variable ‘x’ changes
later, it will not change the value of variable ‘y’
(C) The value of variable ‘y’ is assigned to variable ‘x’ but if variable ‘y’ changes
later, it will change the value of variable ‘x’
(D) The value of variable ‘x’ is assigned to variable ‘y’ but if variable ‘x’ changes
later, it will change the value of variable ‘y’
13. Which of the following is responsible for conversion of C program to machine
language?
(A) Interpreter
(B) Compiler
(C) Operating System
(D) Editor
14. Which of the following is not a basic data type in ‘C’ language?
(A) double
(B) float
(C) char
(D) array
include<stdio.h>
void main(){
int i=2;
printf("%d %d", ++i, i--);
}
(A) 22
(B) 33
(C) 32
(D) 23
16. What will be the output of the following C code (considering size of char is 1 and
pointer is 4)?
#include <stdio.h>
void main() {
char *a[2] = {"hello", "hi"};
printf("%d", sizeof(a));
}
(A) 9
(B) 4
(C) 8
(D) 13
17. What will be the output of the following ‘C’ program?
#include<stdio.h>
int X=40;
int main(){
int X=20;
printf("%d\n", X);
return 0;
}
(A) 20
(B) 40
(C) Error
(D) No output
#include<stdio.h>
int main(){
int a[5] = {2, 3},i=1;
printf("%d, %d, %d\n", a[i--], a[i], a[i++]);
return 0;
}
(A) 0,0,3
(B) 2,3,3
(C) 3,2,2
(D) Garbage values
#include<stdio.h>
int main(){
union x
{
int i;
char ch[2];
};
union x u;
u.ch[0] = 0;
u.ch[1] = 2;
printf("%d, %d, %d\n", u.ch[0], u.ch[1], u.i);
return 0;
}
(A) 0, 2, 0
(B) 0, 2, 512
(C) 512, 2, 0
(D) None of the above
20. What will be the output of the following C program?
#include <stdio.h>
int main() {
enum result {fail, pass, unknown, known};
enum result s=unknown;
if (pass !=2)
printf(“%d”, s);
else
printf(“%d”, known);
return 0;
}
(A) 2
(B) 1
(C) unknown
(D) 3
(A) 1
(B) 2
(C) 3
(D) 4
22. Which one of the following is used to define the member of a class externally?
(A) :
(B) ::
(C) #
(D) *
(A) 2
(B) 3
(C) 4
(D) 5
(A) 1
(B) 2
(C) 3
(D) 4
25. How many types of templates are available in C++?
(A) 1
(B) 3
(C) 2
(D) 4
(A) derived class should provide definition for all the pure virtual functions
(B) derived class also become abstract if fails to implement pure virtual functions
(C) objects of derived class can’t be created if it fails to implement pure virtual
functions
(D) All of the above
(A) Overloading
(B) Overriding
(C) Rewriting
(D) All of the above
28. When overloading unary operators using friend function, it requires …………….
argument/s
(A) zero
(B) one
(C) two
(D) three
29. If inner catch handler is not able to handle the exception then
(A) Methods
(B) Instance of class
(C) Pure abstract class
(D) None of the above
31. Which function is used to read a single character from the console in C++?
(A) cin.get(ch)
(B) getline(ch)
(C) read(ch)
(D) scanf(ch)
(A) 1
(B) 2
(C) 3
(D) 4
33. Which is the correct(C) and incorrect (I) form of default constructor for following
class?
#include <iostream>
using namespace std;
class sample{
private:
int x,y;
};
34. Which type of Access Specifier class data member number is?
(A) b is assigned to a
(B) p now points to b
(C) a is assigned to b
(D) q now points to a
#include <iostream>
using namespace std;
int recur(int num) {
return (num)? num%10 + recur(num/10):0;
}
int main(){
cout<<recur(561);
}
(A) 10
(B) 11
(C) 12
(D) 13
#include<iostream>
using namespace std;
int main() {
int a = 5, b = 10, c = 15;
intarr[3] = {&a, &b, &c};
cout<< *arr[*arr[1] - 8];
return 0;
}
(A) 15
(B) 18
(C) garbage value
(D) compile time error
39. Which of the following is not a type of constructor?
#include <iostream>
using namespace std;
struct sec{
int a;
char b;
};
int main() {
struct sec s ={25,50};
struct sec *ps =(struct sec *)&s;
cout<<ps->a <<" "<<ps->b;
return 0;
}
(A) 25 2
(B) 25 3
(C) 25 4
(D) 26 2
(A) O (n)
(B) ( )
O n2
(C) O ( n log n )
(D) O ( log n )
43. The postorder traversal of binary tree is DEBFCA. Find out the preorder traversal.
(A) ABFCDE
(B) ADBFEC
(C) ABDECF
(D) ABDCEF
45. For an undirected graph with ‘n’ vertices and ‘e’ edges, the sum of the degree of each
vertex is equal to
(A) 2n
2n − 1
(B)
2
(C) 2e
e2
(D)
2
46. How many nodes does a complete binary tree of level 5 have?
(A) 20
(B) 63
(C) 30
(D) 73
47. A tree, for which at every node the height of its left subtree and right subtree differ at
most by one is a/an
(A) (4, 7)
(B) (7, 4)
(C) (8, 3)
(D) (3, 8)
49. Any node in the path from the root in any tree is called
51. What does the following function do for a given Linked List with first node as head?
53. Which of the following algorithms scans the list by swapping the entries whenever
pair of adjacent keys is out of desired order?
54. A linear list in which each node has pointer to point to the predecessor and successor
is called as
55. A hash table of length 10 uses open addressing with hash function h(k)=k mod 10,
and linear probing. The contents of the table after inserting 6 values into an empty
hash table is as follows
Which one of the following choices gives a possible order in which the key values
could have been inserted in the table?
(A) Queues
(B) Stacks
(C) Dequeues
(D) Binary search tree
(12 – a) * (b + 9) / (d * 4)
(A) 4 b * d 9 + a 12 – * /
(B) / 12 a – b 9 + d 4 *
(C) 12 – a * b + 9 / d * 4
(D) 12 a – b 9 + * d 4 * /
58. The optimal time T ( n ) of the Tower of Hanoi problem with n discs is
(A) 2T(n – 2) + 2
(B) 2T(n – 1) + n
n
(C) 2T + 1
2
(D) 2T(n – 1) + 1
59. Which of the following technique is used to find all pairs of shortest distances in a
graph?
61. Which of the following methods can be used to solve n-Queen’s problem?
64. Which of the following algorithms can be used to solve the Hamiltonian path problem
efficiently?
65. For the undirected, weighted graph given below, which of the following sequences of
edges represents a correct execution of Prim’s algorithm to construct a Minimum
Spanning Tree?
(A) (a, b), (d, f), (f, c), (g, i), (d, a), (g, h), (c, e), (f, h)
(B) (c, e), (c, f), (f, d), (d, a), (a, b), (g, h), (h, f), (g, i)
(C) (d, f), (f, c), (d, a), (a, b), (c, e), (f, h), (g, h), (g, i)
(D) (h, g), (g, i), (h, f), (f, c), (f, d), (d, a), (a, b), (c, e)
66. Which data structure is very useful when data has to be stored and then retrieved in
reverse order?
(A) Stack
(B) Queue
(C) List
(D) Linked List
67. A directed graph is ……………… if there is a path from each vertex to every other
vertex in the graph
68. Which matrix has most of the elements (not all) as Zero?
(A) O ( log V )
(B) O ( E log V )
(C) ( )
O E2
(D) O (V log E )
71. From the following sorting algorithms which algorithm needs the minimum number
of swaps?
72. The number of swapping needed to sort numbers 8, 22, 7, 9, 31, 19, 5, 13 in ascending
order using bubble sort is
(A) 11
(B) 12
(C) 13
(D) 14
73. Relational calculus is a
(A) rectangle
(B) square
(C) ellipse
(D) triangle
78. Which of the following makes the transaction permanent in the database?
(A) View
(B) Commit
(C) Rollback
(D) Flashback
79. A query in the tuple relational calculus is expressed as
(A) {t | P() | t}
(B) { P(t ) | t}
(C) {t | P(t )}
(D) All of the above
80. Database catalog or dictionary defining the descriptive information of the data is
called as
(A) Tables
(B) Treelike Structure
(C) Complex logical relationships
(D) Records
84. Which two files are used during operation of the DBMS?
(A) Relations
(B) Domains
(C) Queries
(D) None of the above
86. A Relational database which is in 3NF may still have undesirable data redundancy
because of
88. Which of the following algorithm tends to minimize the process flow time?
(A) First Come First Served
(B) Shortest Job First
(C) Earliest Deadline First
(D) Longest Job First
89. Match the following.
(A) fork
(B) create
(C) new
(D) None of the above
92. The interval from the time of submission of a process to the time of completion is
termed as
93. ……………. is the concept in which a process is copied into main memory from the
secondary memory according to the requirement.
(A) Paging
(B) Segmentation
(C) Demand paging
(D) Swapping
94. The maximum number of processes that can be in Ready State with n CPUs is
(A) n
2
(B) n
(C) 2n
(D) Independent of n
(A) Register
(B) Cache
(C) Main memory
(D) Disk
97. Identify the incorrect statement with respect to the Swap Space
(A) Swap space is used when the amount of physical memory is full
(B) Inactive pages are moved into the swap space
(C) Swap space is a replacement for RAM
(D) Swap space resides in the disk
(A) 7
(B) 12
(C) 10
(D) 13
102. What value will replace the question mark in the following equation?
1 1 1 2
4 + 3 + ? + 2 = 13
2 6 3 5
2
(A) 3
5
4
(B) 3
8
4
(C) 3
5
2
(D) 3
8
103. An aeroplane covers a certain distance at a speed of 240 kmph in 5 hours. To cover
2
the same distance in 1 hours, it must travel at a speed of
3
(A) 3
(B) 5
(C) 8
(D) 9
105. ‘A’ can do a work in 15 days and ‘B’ in 20 days. If they work on it together for
4 days, then the fraction of the work that is left is
1
(A)
4
1
(B)
10
7
(C)
15
8
(D)
15
106. The length of a room is 5.5 m and width is 3.75 m. Find the cost of paving the floor
by slabs at the rate of `800 per sq. metre.
(A) `15,000
(B) `15,550
(C) `15,600
(D) `16,500
107. There are 10 lamps in a hall. Each one of them can be switched on independently. The
number of ways in which the hall can be illuminated is
2
(A) 10
10
(B) 2
(C) 1023
(D) 10!
108. The difference between two positive numbers is 3 and the sum of their squares is 369.
Then the sum of the numbers is
(A) 33
(B) 20
(C) 81
(D) 27
Q R 2z
109. If P x = Q y = R z and = , then =?
P Q ( x + z)
y
(A)
z
y
(B)
x
x
(C)
y
z
(D)
y
110. Choose the number pair which differs from others in the group
111. The price of oil increases by 25%. By what percentage must a customer reduce the
consumption so that the earlier bill on oil does not alter?
(A) 35%
(B) 30%
(C) 25%
(D) 20%
(A) 31
(B) 61
(C) 71
(D) 91
113. Direction: In the question below, there is a sentence of which some parts have been
jumbled up. Rearrange these parts which are labeled P,Q,R,S to produce the correct
sequence. Choose the proper sequence from the given alternatives.
P: Einstein was
Q: although a great scientist
R: weak in arithmetic
S: right from his school days
(A) SRPQ
(B) QPRS
(C) QPSR
(D) RQPS
114. A box contains 2 white balls, 3 black balls and 4 red balls. In how many ways can
3 balls be drawn from the box, if at least one black ball is to be included in the draw?
(A) 32
(B) 48
(C) 64
(D) 96
(A) 11
(B) 13
(C) 15
(D) 17
116. A right triangle with sides 3 cm, 4 cm and 5 cm is rotated about the side of 3 cm to
form a cone. The volume of the cone so formed is
3
(A) 12π cm
3
(B) 15π cm
3
(C) 16π cm
3
(D) 20π cm
117. A, P, R, X, S and Z are sitting in a row. S and Z are in the centre. A and P are at the
ends. R is sitting to the left of A. Who is to the right of P?
(A) A
(B) X
(C) S
(D) Z
118. You go North, turn right, then right again and then go to the left. In which direction
are you now?
(A) North
(B) South
(C) East
(D) West
119. Five children take part in a tournament. Each one has to play with every other one.
How many games must they play?
(A) 8
(B) 10
(C) 24
(D) 12
(A) 1
(B) 8
(C) 5
(D) 6
(A) 5
(B) 2
(C) 1
(D) 3
122. Which number replaces the question mark?
(A) 3
(B) 4
(C) 6
(D) 14
Select the correct pattern given in the options from (1) - (4) that has to be replaced in
the place of “?”
(A) 1
(B) 2
(C) 3
(D) 4
124. Look carefully at the sequence of symbols to find the pattern
Select the correct pattern given in the options from (1) - (4) that has to be replaced in
the place of “?”
(A) 1
(B) 2
(C) 3
(D) 4
Select the correct pattern given in the options from (1) - (4) that has to be replaced in
the place of “?”
(A) 1
(B) 2
(C) 3
(D) 4
126. Select a suitable figure from the four alternatives that would complete the figure
matrix
Select the correct pattern given in the options from (1) - (4) that has to be replaced in
the place of “?”
(A) 1
(B) 2
(C) 3
(D) 4
(A) 2
(B) 3
(C) 4
(D) 5
128. If a mirror is placed on the line MN, then which of the answer figures is the right
image of the given figure?
(A)
(B)
(C)
(D)
129. Which figure from the four alternatives given below, is the correct mirror image of
the main figure, iff a mirror is placed on the line MN?
(A)
(B)
(C)
(D)
130. A man leaves his office and turning East, walks 10 m straight. He then turns towards
South and walks 5 m and then turns East and walks 5 m. After turning south, he walks
10 m and then turns West and walks 35 m. How far he is from his office?
(A) 25 m
(B) 20 m
(C) 30 m
(D) 10 m
(A) SKY
(B) GYM
(C) DRY
(D) FUN
(A) JQNK
(B) IRSQ
(C) IPNQ
(D) IRNK
133. If first four letters of the word APPEARANCE are written in reverse order and the
next four letters are again written in reverse order and the remaining letters are again
written in reverse order, then after this change, which will be the sixth letter from
your right?
(A) N
(B) A
(C) P
(D) R
(A) LIH
(B) MII
(C) III
(D) MIF
135. Which set of letters, when sequentially placed at the gaps in the given series,
completes it?
_bc_ca_aba_c_ca
(A) abcbb
(B) bbbcc
(C) baaba
(D) abbcc
(A) 24
(B) 12
(C) 8
(D) 4
(A) 96
(B) 5
(C) 11
(D) 191
(A) 75
(B) 67.5
(C) 72
(D) 68
(A) 1752
(B) 3504
(C) 3502
(D) 3508
140. Which is the next number in the series?
(A) 24
(B) 25
(C) 26
(D) 27
(A) 79
(B) 39
(C) 69
(D) 99
(A) 2
(B) 3
(C) 4
(D) 6
(A) VMZWMFN
(B) MFMXZMV
(C) NFMWZMV
(D) NFMWZMX
144. ACADEMIC is coded as AACEDIMC. Find the code for ACCURACY under the same rule
(A) CAUCARYC
(B) ACCRUCAY
(C) ACRUACCY
(D) None of the above
145. If PROSE is coded as PPOQE, how is LIGHT coded under the same rule?
(A) LIGFT
(B) LGGHT
(C) LLGFE
(D) LGGFT
146. Direction: Arrange the sentences (P, Q, R and S) in the correct order. The first
sentence is given as
P There are about four hundred old stone bridges joining the island of Venice
Q In this city there are no motor cars, no horses, no buses
R This is because Venice has no streets
S It is not an island but a hundred and seventeen islands
(A) PQRS
(B) PRQS
(C) SQRP
(D) SPQR
147. Direction: Arrange the sentences (P, Q, R and S) in the correct order. The first
sentence is given as
(A) PQRS
(B) SRQP
(C) QPRS
(D) QPSR
(A) Tailor
(B) Textile
(C) Fibre
(D) Mill
149. What will be the simple interest earned on an amount of `16,800 in 9 months at the
1
rate of 6 % p.a ?
4
(A) `787.50
(B) `812.50
(C) `860
(D) `887.50
(A) 55 : 77 : 66
(B) 30 : 42 : 77
(C) 35 : 49 : 42
(D) 39 : 27 : 32
FINAL ANSWER KEY
Subject Name: 502 MSC COMPUTER SCIENCE
SI No. Key SI No. Key SI No. Key SI No. Key SI No. Key
1 A 31 A 61 D 91 B 121 B
2 B 32 B 62 C 92 C 122 B
3 D 33 A 63 A 93 C 123 B
4 D 34 A 64 D 94 D 124 A
5 B 35 C 65 C 95 D 125 A
6 A 36 B 66 A 96 D 126 B
7 A 37 C 67 B 97 C 127 C
8 D 38 D 68 A 98 B 128 D
9 A 39 B 69 B 99 A 129 D
10 C 40 A 70 B 100 B 130 A
11 C 41 B 71 D 101 C 131 D
12 A 42 C 72 D 102 A 132 D
13 B 43 D 73 B 103 D 133 A
14 D 44 B 74 C 104 C 134 A
15 A 45 C 75 C 105 D 135 A
16 C 46 B 76 B 106 D 136 C
17 A 47 B 77 D 107 C 137 A
18 A 48 B 78 B 108 D 138 B
19 B 49 A 79 C 109 B 139 D
20 A 50 D 80 B 110 B 140 A
21 C 51 B 81 A 111 D 141 A
22 B 52 D 82 D 112 D 142 B
23 D 53 D 83 B 113 B 143 C
24 C 54 A 84 A 114 C 144 B
25 C 55 D 85 C 115 B 145 D
26 D 56 A 86 D 116 A 146 D
27 B 57 D 87 D 117 B 147 A
28 B 58 D 88 B 118 C 148 D
29 C 59 A 89 A 119 B 149 A
30 C 60 A 90 A 120 C 150 B