













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!














1. The expenditure on the project _________ as
follows: equipment Rs.20 lakhs, salaries Rs.
lakhs, and contingency Rs.3 lakhs.
A. break down B. break
C. breaks down D. breaks
Ans. C
Sol.
Break down means to separate something into
smaller parts. The subject-word agreement states
that Singular nouns go with singular verbs while
plural nouns go with plural verbs. Expenditure is
singular noun, and its plural form is expenditures.
The expenditure ( singular noun ) in the project
breaks ( singular verb used in the phrase ) down
as follows. The above statement satisfies the
subject verb agreement and hence, the correct
option is C.
2. The search engineโs business model ___________
around the fulcrum of trust.
A. revolves B. plays
C. sinks D. bursts
Ans. A
Sol.
The search engine business model revolves around
the fulcrum of trust.
Fulcrum is anything that plays a central or
essential role in an activity, event, or situation.
3. Two cars start at the same time from the same
location and go in the same direction. The speed of
the first car is 50 km/h and the speed of the
second car is 60 km/h. The number of hours it
takes for the distance between the two cars to be
20 km is ____________.
Ans. B
Sol.
Speed of car A = 50 km/hr
Speed of car B = 60 km/hr
Since, both cars A and B are moving in same
direction, the relative speed = 60 โ 50 = 10 km/hr
Distance required between them = 20 km
4. Ten friends planned to share equally the cost of
buying a gift for their teacher. When two of them
decided not to contribute, each of the other friends
had to pay Rs 150 more. The cost of the gift was Rs.
Ans. C
Sol.
Let share of each student = x
Total cost of gift = 10 * x
10x = 8(x + 150)
10x = 8x + 1200
2x = 1200
x = 600
Thus, Total cost of gift = 10 ร 600 = 6000.
5. A court is to a judge as ___________ is to a
teacher.
A. a student B. a punishment
C. a syllabus D. a school
Ans. D
Sol.
A โcourtโ is for a โjudgeโ as a โschoolโ is for a
โteacherโ.
Court is a place where a judge works.
Similarly, school is a place where a teacher works.
6. The police arrested four criminals โ P, Q, R and S.
The criminals knew each other. They made the
following statements:
P says, โQ committed the crime.โ
Q says, โS committed the crime.โ
R says, โI did not do it.โ
S says, โWhat Q said about me is false.โ
Sol.
The passage states that the underlying disease
behind begging is the failure of the state to protect
citizens who fall through the social security net.
Thus, Option B can be concluded from the above.
9. In a college, there are three student clubs. Sixty
students are only in the Drama club, 80 students are
only in the Dance club, 30 students are only in the
Maths club, 40 students are in both Drama and
Dance clubs, 12 students are in both Dance and
Maths clubs, 7 students are in both Drama and
Maths clubs, and 2 students are in all the clubs. If
75% of the students in the college are not in any of
these clubs, then the total number of students in the
college is ___________.
Ans. C
Sol.
Total number of students in all three clubs = 60 +
Total number of students in the college = X
Given that 75% of students are not of any of these
three clubs.
Remaining 25% of X = 225
10. Three of the five students allocated to a hostel put
in special requests to the warden. Given the floor
plan of the vacant rooms, select the allocation plan
that will accommodate all their requests.
Request by X: Due to pollen allergy, I want to
avoid a wing next to the garden.
Request by Y: I want to live as far from the
washrooms as possible, since I am very sensitive
to smell.
Request by Z: I believe in Vaastu and so want to
stay in the South-west wing.
The shaded rooms are already occupied. WR is
washroom.
Ans. D
Sol.
In such type of question use the Option
elimination method
Because of Request from X : Option B is eliminated
as it cannot be satisfied in that option.
Because of Request from Y : None of the option
can be eliminated as it can is satisfied in all
options.
Because of Request from Z : We can select D as an
answer because none of the other option satisfy it.
So according to conditions mentioned in the
question โDโ is the best suited option.
The number of possible ordered pairs (x, X) where
x โ X is then 2
n- 1
sets. Now, for n elements total
n โ 2
n- 1
number of order pairs are possible.
Thus, statement I is true.
But since by the combinatoric identity
n
n 41
k 1
โ
=
๏ฅ
Statement II is identity similar to statement I, thus
also true.
6. Which one of the following is NOT a valid identity?
A. (x โจ y) โจ z = x โจ (y โจ z)
B. (x + y) โจ z = x โจ (y + z)
C. x โจ y = x + y, if xy = 0
D. x โจ y = (xy + xโฒyโฒ)โฒ
Ans. B
Sol.
A. XOR is associative so(xโy)โz=xโ(yโz)
B. For 2 input, XOR and XNOR are complement to
each other, i.e., xโy=(xy+xโฒyโฒ)โฒ
C. xโy=x+y , if xy=
Only false statement is option B.
7. If ๐ฟ is a regular language over ฮฃ = {๐,b}, which
one of the following languages is NOT regular?
๐
= {๐ฅ๐ฆ | ๐ฅ โ ๐ฟ, ๐ฆ
๐
โ ๐ฟ}
๐
| ๐ค โ ๐ฟ}
C. Prefix (๐ฟ) = {๐ฅ โ ๐ด
โ
|โ๐ฆ โ ๐ดโ such that ๐ฅ๐ฆ โ ๐ฟ}
D. Suffix (๐ฟ) = {๐ฆ โ ๐ด
โ
|โ๐ฅ โ ๐ดโ such that ๐ฅ๐ฆ โ ๐ฟ}
Ans. B
Sol.
If L is regular, L โ L
R
is also regular by closure
property.
Suffix (L) and Prefix (L) are also regular by closure
property.
However option (b) {ww
R
|w โ L} need not be
regular since if L is an infinite regular language, then
{ww
R
|w โ L} will not only be infinite, but also non-
regular. Since it involves string matching and we
can increase in length indefinitely and then finite
automata FA will run out of memory.
8. Consider Z = X โ Y, where X, Y and Z are all in sign-
magnitude form. X and Y are each represented
in ๐ bits. To avoid overflow, the representation of Z
would require a minimum of:
A. n bits B. n - 1 bits
C. n + 1 bits D. n + 2 bits
Ans. C
Sol. For example:
Let,
Hence,
Z = 11 which required 5 bits which is (n + 1) bits
9. Let X be a square matrix. Consider the following
two statements on X.
I. X is invertible.
II. Determinant of X is non-zero.
Which one of the following is TRUE?
A. I implies II; II does not imply I.
B. II implies I; I does not imply II.
C. I does not imply II; II does not imply I.
D. I and II are equivalent statements.
Ans. D
Sol. Matrix is invertible if and only if it has nonzero
determinant.
And if the matrix has nonzero determinant, we can
find the inverse as well.
So, both I and II are equivalent statements.
10. Let G be an arbitrary group. Consider the following
relations on G:
1
: โ๐, b โ ๐บ, ๐ ๐ 1
๐ if and only if โ๐ โ ๐บ such that
a = g
bg
2
: โ๐, b โ ๐บ, ๐ ๐ 2
๐ if and only if a = b
Which of the above is/are equivalence
relation/relations?
1
and R 2
1
only
2
only D. Neither R 1
nor R 2
Ans. B
Sol. R 1
: โa, b โ G, a R 1
b if and only if โg โ G such that
a = g
bg
Reflexive: a = g
ag can be satisfied by putting g =
e, identity โeโ always exists in a group.
So, reflexive.
Symmetric: aRb โ a = g
bg for some g
โ b = gag
= (g
ag
g
always exists for every g โ G.
So, symmetric.
Transitive: aRb and bRc โ a = g
bg 1
and b = g 2
1
cg 2
for some g 1
g 2
Now a = g 1
g 2
cg 2
g 1
= (g 2
g 1
cg 2
g 1
g 1
โ G and g 2
โ G โ g 2
g 1
โ G since group is closed so
aRb and aRb โ aRc hence transitive
Clearly R 1
is equivalence relation.
2
is not equivalence it need not even be reflexive,
since aR 2
a โ a = a
โa which not be true in a
group.
1
is equivalence relation and thus B is the correct
answer.
11. Consider the following two statements about
database transaction schedules:
I. Strict two-phase locking protocol generates
conflict serializable schedules that are also
recoverable.
II. Timestamp-ordering concurrency control
protocol with Thomasโ Write Rule can generate
view serializable schedules that are not conflict
serializable.
Which of the above statements is/are TRUE?
A. I only B. II only
C. Both I and II D. Neither I nor II
Ans. C
Sol. I. Strict 2PL guaranteed conflict serializable
because of 2PL condition and also strict
recoverable.
II. Thomas Write timestamp ordering ensures
serializable. Thomas write rule timestamp ordering
allowed to execute schedule which is view equal
serial schedule based on timestamp ordering.
12. Let G be an undirected complete graph
on ๐ vertices, where n > 2. Then, the number of
different Hamiltonian cycles in G is equal to
A. n! B. (n โ 1)!
Ans. C or D
Sol. In a complete graph we can traverse the n vertices
in any order and return to the starting vertex and
form a Hamiltonian cycle. The number of such
cycles will be n!
However, since circular rotations will have to
ignored. Since for example K 4
with vertices {1, 2,
3, 4}, the cycle 1 - 2 - 3 - 4 is same as 2- 3 - 4 - 1 is
same as 3- 4 - 1 - 2 etc. we now get only (n โ 1)!
distinct Hamiltonian cycles. Further, the cycle 1- 2 -
3 - 4 and 1- 4 - 3 - 2 are also same (clockwise and
anticlockwise).
So, ignoring this orientation also we finally get
( )
distinct Hamiltonian cycles.
However, in gate answer key, the answer key was
given as C or D.
13. Compute
4
2
x 3
โ
C. 108/7 D. Limit does not exist
Ans. C
Sol.
4
2
3
โ
x
form.
So, apply LโH rule:
3
x 3
โ
14. Which one of the following statements is NOT
correct about the B
tree data structure used for
creating an index of a relational database table?
A. B+ Tree is a height-balanced tree
B. Non-leaf nodes have pointers to data records
C. Key values in each node are kept in sorted order
D. Each leaf node has a pointer to the next leaf
node
Ans. B
Sol.
B+ tree non leaf node have pointer to data records
is false statement.
B+ tree non leaf node consists of only keys and
tree pointers (node pointers).
Below is the structure of B+ tree non leaf node
Compute the FOLLOW set of the non-terminal B and
write the index values for the symbols in the
FOLLOW set in the descending order. (For example,
if the FOLLOW set is {a, b, d, $}, then the answer
should be 3210)
Ans. 31
Sol.
S โ Aa
B โ b | โ
D โ d | โ
Follow (B) = {d, a}
Hence their index in descending order is 31.
20. An array of 25 distinct elements is to be sorted using
quicksort. Assume that the pivot element is chosen
uniformly at random. The probability that the pivot
element gets placed in the worst possible location in
the first round of partitioning (rounded off to 2
decimal places) is ________.
Ans. 0.
Sol.
Given an array of 25 distinct elements, and pivot
element is chosen uniformly randomly. So, there are
only 2 worst case position in the pivot element, that
is, it is either first (or) last.
Therefore, required probability is,
21. The value of 3
51
mod 5 is ________.
Ans. 2
Sol.
By Fermatโs theorem
(5 โ 1)
mod 5 = 1
4
mod 5 = 1
Now, 3
51
mod 5 = (
4
12
3
mod 5
3
mod 5
22. Two numbers are chosen independently and
uniformly at random from the set
{1, 2,...,13}. The probability (rounded off to 3
decimal places) that their 4-bit (unsigned) binary
representations have the same most significant bit
is ___________.
Ans. 0.502 to 0.
Sol.
The binary representation of numbers
(1,2,3......13) in 4-bits:
As it can be seen that there are 6 numbers whose
MSB is 1, and 7 numbers which start with 0.
So the probability that their 4-bit binary
representation have the same MSB is :
= P(MSB is 0) + P(MSB is 1)
23. Consider three concurrent processes P1, P2 and P
as shown below, which access a shared variable D
that has been initialized to 100
The processes are executed on a uniprocessor
system running a time-shared operating system. If
the minimum and maximum possible values of D
after the three processes have completed
execution are X and Y respectively, then the value
of Y โ X is _____________.
Ans. 80
Sol.
Total possible sequences of execution are: P1 P
P3, P1 P3 P2, P2 P1 P3, P2 P3 P1, P3 P1 P2 and P
Whatever the sequence we will use to execute, we
will get 80 as answer.
So, X= 50 and Y= 130
Hence, Y-X = 80
24. Consider the following C program:
#include <stdio.h>
int main(){
int arr[]={1,2,3,4,5,6,7,8,9,0,1,2,5},
*ip=arr+4;
printf(โ%d\nโ, ip[1]);
return 0;
The number that will be displayed on execution of
the program is ___________.
Ans. 6
Sol.
Here answer will be 6.
ip is an integer pointer. The initial assignment sets
it to the element at array index 4 i.e. 5.
Hence ip holds address of array index 4
The next statement refers to the next integer after
it which is 6(ip[1]=โ(ip+1))
25. Consider a sequence of 14 elements: A = [โ5, โ10,
6, 3, โ1, โ2, 13, 4, โ9, โ1, 4, 12, โ3, 0]. The
subsequence sum ๐
๐
๐=๐
. Determine the
maximum of S(i, j), where 0 โค i โค j < 14. (Divide
and conquer approach may be used.)
Ans. 29
Sol.
The maximum sum of the array
which sum up to 29.
26. Consider the following C function.
void convert(int n){
if(n<0)
printf(โ%dโ,n);
else {
convert(n/2);
printf(โ%dโ,n%2);
Which one of the following will happen when the
function convert is called with any positive integer
n as argument?
A. It will print the binary representation of n and
terminate
B. It will print the binary representation of n in the
reverse order and terminate
C. It will print the binary representation of n but
will not terminate
D. It will not print anything and will not terminate
Ans. D
Sol.
Let n=5,
function calling goes as: convert(5) โ convert(2)
โ convert(1) โ convert(0) now when we go for
convert(0) then in if condition its mentioned as
if(n<0) but our n = 0 , so still the condition is
false, it will go into else block and implement
convert(0/2) which is convert(0) , so it will go on
calling the same way again and again leading to
stack overflow.
Hence, the program will not print anything (as
after every function call, the value returned is
greater than 0) and will not terminate.
27. Consider the following C program:
#include<stdio.h>
int r(){
static int num=7;
return num--;
Ans. A
Sol.
f 1
. f 2
f = f 3
โ (f 1
. f 2
31. Which one of the following languages over ฮฃ = {a,
b}is NOT context-free?
A. {ww
R
|w โ {a,b}
B. {wa
n
b
n
w
R
|w โ{a, b}
, n โฅ 0}
C. {wa
n
w
R
b
n
|w โ{a,b}
, n โฅ 0}
D. {a
n
b
i
|i โ {n, 3n, 5n}, n โฅ 0}
Ans. C
Sol.
(a) {ww
R
|w โ {a, b}* } is a CFL
(b) {wa
n
b
n
w
R
|w โ {a, b}*, n โฅ 0} is a CFL, since
we can first push w, then aโs, bโs pop with aโs and
w
R
pops with the w. So PDA can accept the
language.
(c) {wa
n
w
R
b
n
|w โ {a, b}*, n โฅ 0} is a not CFL
because after pushing w, we need to push aโs into
stack which will stop the w from being matched with
w
R
. If we donโt push aโs after w, than later we cannot
match with bn. So this language is not acceptable
by a PDA and hence not a CFL.
(d) {a
n
b
i
|i โ {n, 3n, 5n}, n โฅ 0}
= a
n
b
n
โช a
n
b
3n
โช a
n
b
5n
is CFL since each of the three
parts is a CFL and closure under union guarantees
that result also is a CFL.
32. Let the set of functional dependencies F =
{QR โ S, R โ P, S โ Q} hold on a relation
schema X = (PQRS). X is not in BCNF. Suppose X
is decomposed into two schemas Y and Z, where Y
= (PR) and Z = (QRS).
Consider the two statements given below.
I. Both Y and Z are in BCNF.
II. Decomposition of X into Y and Z is dependency
preserving and lossless.
Which of the above statements is/are correct?
A. Both I and II B. I only
C. II only D. Neither I nor II
Ans. C
Sol. X(PQRS) {QR โ S, R โ P, S โ Q} decomposed
into
Candidate key : R Candidate key : QR,RS
Relation Y in BCNF Relation Z in 3NF but not in
Common attribute between Y and Z relations is R
which is key for relation Y.
So that given decomposition is lossless join
decomposition.
R โ P in Y
are in Z
and dependency preserving decomposition.
Hence, C is the correct answer.
33. Assume that in a certain computer, the virtual
addresses are 64 bits long and the physical
addresses are 48 bits long. The memory is word
addressable. The page size is 8 kB and the word size
is 4 bytes. The Translation Look-aside Buffer (TLB)
in the address translation path has 128 valid entries.
At most how many distinct virtual addresses can be
translated without any TLB miss?
10
10
20
20
Ans. B
Sol. 1 word = 4 bytes
Page size = 8 kB = 2
13
Number of words in 1 page
13
11
2
TLB can hold 128 valid entries so, at most 128 ร
11
memory address can be addressed without TLB
miss.
11
10
34. Consider the following sets:
S1 Set of all recursively enumerable languages
over the alphabet {0,1}
S2 Set of all syntactically valid C programs
S3 Set of all languages over the alphabet {0,1}
S4 Set of all non-regular languages over the
alphabet {0,1}
Which of the above sets are uncountable?
A. S1 and S2 B. S3 and S
C. S2 and S3 D. S1 and S
Ans. B
Sol.
1
: The set L RE
is known to be countably infinite
since it corresponds with set of turing machines.
2
: Since syntactically valid C programs surely run-
on Turing machines, this set is also a subset of set
of Turing machines, which is countable.
3
: Set of all languages = 2
ฮฃ
which is known to be
uncountable. ฮฃ
countably infinite
ฮฃ
is uncountable.
4
: Set of all non-regular languages includes set L NOT
RE
which is uncountable infinite and hence is
uncountable.
So, S 3
and S 4
are uncountable.
Hence, B is the correct answer.
35. Consider the first order predicate formula ๐:
Here โa|bโ denotes that โa divides bโ, where a and b
are integers. Consider the following sets:
S2: Set of all positive integers
S3: Set of all integers
Which of the above sets satisfy ๐?
A. S1 and S2 B. S1 and S
C. S2 and S3 D. S1, S2 and S
Ans. C
Sol.
โx[โzโx โ ((z = x) โจ (z = 1)) โ โw (w > x) โง (โz
zโw โ ((w = z) โจ (z = 1)))]
The predicate ฯ simply says that if z is a prime
number in the set then there exists another prime
number is the set which is larger.
Clearly ฯ is true in S 2
and S 3
since in set of all
integers as well as all positive integers, there is a
prime number greater than any given prime
number.
However, in S 1
: {1, 2, 3, .....100} ฯ is false since
for prime number 97 โ S 1
there exists no prime
number in the set which is greater.
So correct answer is C.
36. Consider the following grammar and the semantic
actions to support the inherited type declaration
attributes. Let X 1
2
3
4
5
, and X 6
be the
placeholders for the non-terminals D, T, L or L1 in
the following table:
Production
rule
Semantic action
1
.type = X 2
.type
T.type = int
1
, id
3
.type = X 4
.type
addType(id.entry, X 5
.type)
6
.type)
Which one of the following are the appropriate
choices for ๐ 1
2
3
and ๐ 4
1
2
3
1
4
1
2
3
1
4
1
2
3
1
4
1
2
3
4
1
Ans. A
Sol.
SDT for inserting type information in the symbol
table
D โ TL {L.idtype = T.stype}
T โ int {T.stype = int}
T โ float {T.stype = float}
L โ L1, id {L1.itype = L.itype}
addtype(id.entry, L.itype)
L โ id addtype(id.entry, L.itype)
III. A max-heap can be constructed from a binary
search tree in ฮ(๐) time
IV. A binary search tree can be constructed from a
max-heap in ฮ(๐) time
Which of the above statements are TRUE?
A. I, II and III B. I, II and IV
C. I, III and IV D. II, III and IV
Ans. A
Sol.
The smallest element in a max-heap is always at a
leaf node โ TRUE because by definition of a max-
heap every parent node must be larger than its
child node.
The second largest element in a max-heap is
always a child of a root node โ TRUE. The k
th
largest element cannot have more than kโ
parents (larger value nodes) and so cannot be
lower than level k.
A max heap can be constructed from a binary
search tree in ฮ(n) time. Build heap for any array
of size n (even unsorted) can be done in O(n) time.
Thus, A is the correct answer.
41. Consider the following four processes with arrival
times (in milliseconds) and their length of CPU
bursts (in milliseconds) as shown below:
These processes are run on a single processor using
preemptive Shortest Remaining Time First
scheduling algorithm. If the average waiting time of
the processes is 1 millisecond, then the value of Z
is________.
Ans. 2
Sol. Till time = 4 units, this is the Gantt chart:
At this point P4 arrives with burst 2 & P3 is in
queue with burst 3.
P1 & P2 have executed with P1 incurred delay of 1
unit & P2 with 0 units.
Hence, Average = 0+1+x/4 =
โ x=3, the next delay should be at 3. It would
happen if assume Z=2.
It executes and completes at 6.
P3 will wait totally for 3 units.
Hence, Average =1.
42. The index node (inode) of a Unix-like file system has
12 direct, one single-indirect and one double-
indirect pointers. The disk block size is 4 kB, and the
disk block address is 32-bits long. The maximum
possible file size is (rounded off to 1 decimal place)
Ans. 4
Sol.
Given 12 direct, 1 single indirect, 1 double indirect
pointer.
Size of Disk block = 4kB
Disk Block Address = 32 bit = 4B
Number of addresses = Size of disk block/address
size =
Maximum possible file size = 12 * 4kB + 2
10
10
10
Hence 4GB is the correct answer.
43. Consider the augmented grammar given below:
S โ โฉLโช | id
Let I 0
= CLOSURE ({[S' โ โข S]}). The number of
items in the set GOTO (I 0
, โฉ) is: ________.
Ans. 5
Sol.
Total number of items in the set GOTO
0
, โฉ) is 5.
44. Consider the following matrix:
The absolute value of the product of Eigen values
of R is ___ _________.
Ans. 12
Sol.
Product of eigenvalues is same as the determinant
of a matrix.
2 3 2 3
2 3 2 2 3 3
2 3 2 2 3 3
2 3 2 2 3 3
( ) ( ) ( )
45. A certain processor deploys a single-level cache. The
cache block size is 8 words, and the word size is 4
bytes. The memory system uses a 60-MHz clock. To
service a cache miss, the memory controller first
takes 1 cycle to accept the starting address of the
block, it then takes 3 cycles to fetch all the eight
words of the block, and finally transmits the words
of the requested block at the rate of 1 word per
cycle. The maximum bandwidth for the memory
system when the program running on the processor
issues a series of read operations is __________ร
6
bytes/sec.
Ans. 160
Sol.
Time to transfer a cache block =1+3+8=12 cycles.
i.e., 4 bytes ร8=32 bytes in 12 cycles.
So, memory bandwidth =32/12 cycle time=32/ 12/
6
6
bytes/s
46. Let T be a full binary tree with 8 leaves. (A full binary
tree has every level full.) Suppose two leaves a and
b of T are chosen uniformly and independently at
random. The expected value of the distance
between a and b in T (i.e., the number of edges in
the unique path between a and b) is (rounded off to
2 decimal places) ___________.
Ans. 4.
Sol.
See the word "independently" here. It means that
choice of โaโ must not affect choice of โbโ and vice
versa. This implies that both โaโ and โbโ can even be
the same node.
Now, we are given that the binary tree has 8leaves.
3
=8) โนwe have 3 levels in the tree starting from
edges between any two leaf nodes will always
be even. If we consider any two leaves (not
necessarily distinct)
leaf nodes, we have a pair and since the selection
is independent order of the pair is also significant)
node we must go two levels up and while coming
down we have 2 choices. So, we get 8ร2=
pairs)
node we must go till the root, and from there while
coming down it has 2ร2=4 choices. Thus, we
get8ร4= 32 pairs.
No. of pairs with path length 0=8.
No. of pairs with path length 1=0.
No. of pairs with path length 2=8.
No. of pairs with path length 3=0.
No. of pairs with path length 4=16.
No. of pairs with path length 5=0.
No. of pairs with path length 6=32.
( ) ( )
51. A relational database contains two tables Student
and Performance as shown below:
Student
Performance
The primary key of the Student table is Roll_no.
For the Performance table, the columns Roll_no.
and Subject_code together form the primary key.
Consider the SQL query given below:
SELECT S.Student_name, sum(P.Marks)
FROM Student S, Performance P
WHERE P.Marks > 84
GROUP BY S.Student_name;
The number of rows returned by the above SQL
query is ________.
Ans. 5
Sol.
SELECT S.Student_name,sum(P.Marks)
FROM Student S,Performance P
WHERE P.Marks>
GROUP BY S.Student_name;
Student Sum
(P.Marks)
Rohan 452
Vinit 452
Priya 452
Amit 452
Smita 452
The number of rows returned is 5.
52. Consider the following C program:
#include<stdio.h>
int main () {
float sum = 0.0, j = 1.0, i = 2.0;
while (i/j > 0.0625) {
j = j + j;
sum = sum + i/j;
printf("%f\n", sum);
return 0;
The number of times the variable sum will be
printed, when the above program is executed, is
Ans. 5
Sol.
initially j=1.0; i=2.
1st iteration- i/j=
2nd iteration- i/j=
true j=2+2=4---> print sum
3rd iteration- i/j=
true j=4+4=8---> print sum
4th iteration- i/j=
true j=8+8=16--->print sum
5th iteration- i/j=
true j=16+16=32---> print sum
6th iteration- i/j=
Hence Sum is printed 5 times.
53. Consider the following C program:
#include <stdio.h>
int main()
int a[] = {2, 4, 6, 8, 10};
int i, sum = 0, *b = a + 4;
for (i = 0; i < 5; i++)
sum = sum + (*b โ i) โ *(b โ i);
printf (โ%d\nโ, sum);
return 0;
The output of the above C program is __________.
Ans. 10
Sol.
sum=0,โb=a+4 i.e. pointing to 10
sum=sum+(โbโi)โโ(bโi)
i=
sum=0+(10โ0)โ(10)=
i=
sum=0+(10โ1)โ(8)=
i=
sum=1+(10โ2)โ(6)=
i=
sum=3+(10โ3)โ(4)=
i=
sum=6+(10โ4)โ(2)=
54. In an RSA cryptosystem, the value of the public
modulus parameter ๐ is 3007. If it is also known
that ฯ(๐) = 2880, where ฯ() denotes Eulerโs Totient
Function, then the prime factor of ๐ which is greater
than 50 is ____________________.
Ans. 97
Sol.
n = p ร q = 3007
By RSA algorithm, n = 31 ร 97 in which 97 is
prime factor which greater than 50.
55. Consider the following relations P(X,Y,Z), Q(X,Y,T)
and R(Y,V).
How many tuples will be returned by the following
relational algebra query?
x (P.Y R.Y R.V V2) x (Q.Y R.Y Q.T 2)
= ๏ = = ๏ ๏พ
๏ฐ ๏ณ ๏ด โ ๏ฐ ๏ณ ๏ด
Ans. 1
Sol.
ฯ (P.Y=R.Y โง R.V=V2)
x
(ฯ (P.Y=R.Y โง R.V=V2)
ฯ (Q.Y=R.Y โง Q.T>2)
x
(ฯ (Q.Y=R.Y
โง Q.T>2)
x
(ฯ (P.Y=R.Y โง R.V=V2)
x
(ฯ (Q.Y=R.Y โง Q.T>2)