Question text and figures as in the official paper, with the answer from the official key. Worked solutions for every question are in your report after you take the paper as a 3-hour test.
Extreme focus on syllabus and studying for tests has become such a dominant concern of Indian students that they close their minds to anything __________ to the requirements of the exam.
(A)
related
(B)
extraneous
(C)
outside
(D)
useful
Answer (official key): B
Worked solution: in your report after you take this paper.
Q2 · General Aptitude · MCQ · 1 mark
The Tamil version of __________ John Abraham-starrer Madras Cafe __________ cleared by the Censor Board with no cuts last week, but the film's distributors __________ no takers among the exhibitors for a release in Tamil Nadu __________ this Friday.
(A)
Mr., was, found, on
(B)
a, was, found, at
(C)
the, was, found, on
(D)
a, being, find at
Answer (official key): C
Worked solution: in your report after you take this paper.
Q3 · General Aptitude · MCQ · 1 mark
A function f(x) is linear and has a value of 29 at x=−2 and 39 at x=3. Find its value at x=5.
(A)
59
(B)
45
(C)
43
(D)
35
Answer (official key): C
Worked solution: in your report after you take this paper.
Q4 · General Aptitude · MCQ · 1 mark
If ROAD is written as URDG, then SWAN should be written as:
(A)
VXDQ
(B)
VZDQ
(C)
VZDP
(D)
UXDQ
Answer (official key): B
Worked solution: in your report after you take this paper.
Q5 · General Aptitude · MCQ · 1 mark
Select the pair that best expresses a relationship similar to that expressed in the pair:
Children : Pediatrician
(A)
Adult : Orthopaedist
(B)
Females : Gynaecologist
(C)
Kidney : Nephrologist
(D)
Skin : Dermatologist
Answer (official key): B
Worked solution: in your report after you take this paper.
Q6 · General Aptitude · MCQ · 2 marks
Alexander turned his attention towards India, since he had conquered Persia.
Which one of the statements below is logically valid and can be inferred from the above sentence?
(A)
Alexander would not have turned his attention towards India had he not conquered Persia.
(B)
Alexander was not ready to rest on his laurels, and wanted to march to India.
(C)
Alexander was completely in control of his army and could command it to move towards India.
(D)
Since Alexander's kingdom extended to Indian borders after the conquest of Persia, he was keen to move further.
Most experts feel that in spite of possessing all the technical skills required to be a batsman of the highest order, he is unlikely to be so due to lack of requisite temperament. He was guilty of throwing away his wicket several times after working hard to lay a strong foundation. His critics pointed out that until he addressed this problem, success at the highest level will continue to elude him.
Which of the statement(s) below is/are logically valid and can be inferred from the above passage?
(i) He was already a successful batsman at the highest level.
(ii) He has to improve his temperament in order to become a great batsman.
(iii) He failed to make many of his good starts count.
(iv) Improving his technical skills will guarantee success.
The head of a newly formed government desires to appoint five of the six selected members P, Q, R, S, T, and U to portfolios of Home, Power, Defense, Telecom, and Finance. U does not want any portfolio if S gets one of the five. R wants either Home or Finance or no portfolio. Q says that if S gets either Power or Telecom, then she must get the other one. T insists on a portfolio if P gets one.
Which is the valid distribution of portfolios?
(A)
P-Home, Q-Power, R-Defense, S-Telecom, T-Finance
(B)
R-Home, S-Power, P-Defense, Q-Telecom, T-Finance
(C)
P-Home, Q-Power, T-Defense, S-Telecom, U-Finance
(D)
Q-Home, U-Power, T-Defense, R-Telecom, P-Finance
Answer (official key): B
Worked solution: in your report after you take this paper.
Q9 · General Aptitude · Numerical · 2 marks
The exports and imports (in crores of Rs.) of a country from the year 2000 to 2007 are given in the following bar chart. In which year is the combined percentage increase in imports and exports the highest?
(Answer in integer)
Answer (official key): 2006
Worked solution: in your report after you take this paper.
Q10 · General Aptitude · MCQ · 2 marks
Choose the most appropriate equation for the function drawn as a thick line, in the plot below.
(A)
x=y−∣y∣
(B)
x=−(y−∣y∣)
(C)
x=y+∣y∣
(D)
x=−(y+∣y∣)
Answer (official key): B
Worked solution: in your report after you take this paper.
Q11 · Discrete Mathematics · MCQ · 1 mark
In a room there are only two types of people, namely Type 1 and Type 2. Type 1 people always tell the truth and Type 2 people always lie. You give a fair coin to a person in that room, without knowing which type he is from and tell him to toss it and hide the result from you till you ask for it.
Upon asking, the person replies the following:
“The result of the toss is head if and only if I am telling the truth.”
Which of the following options is correct?
(A)
The result is head
(B)
The result is tail
(C)
If the person is of Type 2, then the result is tail
(D)
If the person is of Type 1, then the result is tail
Answer (official key): A
Worked solution: in your report after you take this paper.
Q12 · Programming and Data Structures · Numerical · 1 mark
Consider a software project with the following information domain characteristics for calculation of function point metric.
Number of external inputs (I)=30
Number of external outputs (O)=60
Number of external enquiries (E)=23
Number of files (F)=08
Number of external interfaces (N)=02
It is given that the complexity weighting factors for I,O,E,F and N are 4, 5, 4, 10 and 7, respectively. It is also given that, out of fourteen value adjustment factors that influence the development effort, four factors are not applicable, each of the other factors have value 3, and each of the remaining factors have value 4. The computed value of function point metric is __________.
Answer (official key): 612 to 613
Worked solution: in your report after you take this paper.
Q13 · Digital Logic · MCQ · 1 mark
Let # be a binary operator defined as
X#Y=X′+Y′
where X and Y are Boolean variables.
Consider the following two statements:
(S1)(P#Q)#R=P#(Q#R)(S2)Q#R=R#Q
Which of the following is/are true for the Boolean variables P,Q and R?
(A)
Only S1 is true
(B)
Only S2 is true
(C)
Both S1 and S2 are true
(D)
Neither S1 nor S2 are true
Answer (official key): B
Worked solution: in your report after you take this paper.
Q14 · Discrete Mathematics · Numerical · 1 mark
The number of 4 digit numbers having their digits in non-decreasing order from left to right, constructed using the digits belonging to the set {1,2,3}, is __________.
Answer (official key): 15
Worked solution: in your report after you take this paper.
Q15 · Calculus · MCQ · 1 mark
The value of
x→∞lim(1+x2)e−x
is
(A)
0
(B)
21
(C)
1
(D)
∞
Answer (official key): A
Worked solution: in your report after you take this paper.
Q16 · Theory of Computation · MCQ · 1 mark
Let L be the language represented by the regular expression
Σ∗0011Σ∗
where Σ={0,1}. What is the minimum number of states in a DFA that recognizes L, the complement of L?
(A)
4
(B)
5
(C)
6
(D)
8
Answer (official key): B
Worked solution: in your report after you take this paper.
Q17 · Computer Organization and Architecture · MCQ · 1 mark
Consider a machine with a byte addressable main memory of 220 bytes, block size of 16 bytes and a direct mapped cache having 212 cache lines. Let the addresses of two consecutive bytes in main memory be (E201F)16 and (E2020)16. What are the tag and cache line address in hex for main memory address (E201F)16?
(A)
E, 201
(B)
F, 201
(C)
E, E20
(D)
2, 01F
Answer (official key): A
Worked solution: in your report after you take this paper.
Q18 · Computer Networks · MCQ · 1 mark
Consider a CSMA/CD network that transmits data at a rate of 100 Mbps (108 bits per second) over a 1 km cable with no repeaters. If the minimum frame size required for this network is 1250 bytes, what is the signal speed in km/sec in the cable?
(A)
8000
(B)
10000
(C)
16000
(D)
20000
Answer (official key): D
Worked solution: in your report after you take this paper.
Q19 · Programming and Data Structures · Numerical · 1 mark
Consider a software program that is artificially seeded with 100 faults. While testing this program, 159 faults are detected, out of which 75 faults are from those artificially seeded faults. Assuming that both real and seeded faults are of same nature and have same distribution, the estimated number of undetected real faults is __________.
Answer (official key): 28
Worked solution: in your report after you take this paper.
Q20 · Programming and Data Structures · Numerical · 1 mark
Consider a binary tree T that has 200 leaf nodes. Then, the number of nodes in T that have exactly two children are __________.
Answer (official key): 199
Worked solution: in your report after you take this paper.
Q21 · Programming and Data Structures · MCQ · 1 mark
Worked solution: in your report after you take this paper.
Q22 · Programming and Data Structures · MCQ · 1 mark
The result evaluating the postfix expression
10 5 + 60 6 / * 8 -
is
(A)
284
(B)
213
(C)
142
(D)
71
Answer (official key): C
Worked solution: in your report after you take this paper.
Q23 · Linear Algebra · MCQ · 1 mark
In the given matrix
101−112201
one of the eigenvalues is 1. The eigenvectors corresponding to the eigenvalue 1 are
(A)
{α(4,2,1)∣α=0,α∈R}
(B)
{α(−4,2,1)∣α=0,α∈R}
(C)
{α(2,0,1)∣α=0,α∈R}
(D)
{α(−2,0,1)∣α=0,α∈R}
Answer (official key): B
Worked solution: in your report after you take this paper.
Q24 · Programming and Data Structures · MCQ · 1 mark
While inserting the elements 71, 65, 84, 69, 67, 83 in an empty binary search tree (BST) in the sequence shown, the element in the lowest level is
(A)
65
(B)
67
(C)
69
(D)
83
Answer (official key): B
Worked solution: in your report after you take this paper.
Q25 · Computer Networks · MCQ · 1 mark
In a web server, ten webpages are stored with the URLs of the form http://www.yourname.com/var.html, where var is a different number from 1 to 10 for each webpage. Suppose the client stores the webpage with var = 1 locally, edits and then tests. Rest of the webpages remains on the web server. W1 contains several relative URLs of the form ...var.html referring to the other webpages.
Which one of the following statements needs to be added in W1, so that all the relative URLs in W1 refer to the appropriate webpages on the web server?
Worked solution: in your report after you take this paper.
Q26 · Databases · MCQ · 1 mark
Consider the following relation:
Cinema(theater,address,capacity)
Which of the following options will be needed at the end of the SQL query
SELECT P1.address
FROM Cinema P1
such that it always finds the addresses of theaters with maximum capacity?
(A)
WHERE P1.capacity >= ALL (select P2.capacity from Cinema P2)
(B)
WHERE P1.capacity >= ANY (select P2.capacity from Cinema P2)
(C)
WHERE P1.capacity > ALL (select max(P2.capacity) from Cinema P2)
(D)
WHERE P1.capacity > ANY (select max(P2.capacity) from Cinema P2)
Answer (official key): A
Worked solution: in your report after you take this paper.
Q27 · Algorithms · MCQ · 1 mark
Consider the equality
i=0∑ni3=X
and the following choices for X:
I. Θ(n4)
II. Θ(n5)
III. O(n5)
IV. Ω(n3)
The equality above remains correct if X is replaced by
(A)
Only I
(B)
Only II
(C)
I or III or IV but not II
(D)
II or III or IV but not I
Answer (official key): C
Worked solution: in your report after you take this paper.
Q28 · Compiler Design · MCQ · 1 mark
Among simple LR (SLR), canonical LR, and look-ahead LR (LALR), which of the following pairs identify the method that is very easy to implement and the method that is the most powerful, in that order?
(A)
SLR, LALR
(B)
Canonical LR, LALR
(C)
SLR, canonical LR
(D)
LALR, canonical LR
Answer (official key): C
Worked solution: in your report after you take this paper.
Q29 · Operating System · MCQ · 1 mark
The maximum number of processes that can be in Ready state for a computer system with n CPUs is
(A)
n
(B)
n2
(C)
2n
(D)
Independent of n
Answer (official key): D
Worked solution: in your report after you take this paper.
Q30 · Operating System · MCQ · 1 mark
Two processes X and Y need to access a critical section. Consider the following synchronization construct used by both the processes.
/* Process X */
while (true) {
varP = true;
while (varQ == true) {
/* Critical Section */
varP = false;
}
}
/* Process Y */
while (true) {
varQ = true;
while (varP == true) {
/* Critical Section */
varQ = false;
}
}
Here, varP and varQ are shared variables and both are initialized to false. Which one of the following statements is true?
(A)
The proposed solution prevents deadlock but fails to guarantee mutual exclusion
(B)
The proposed solution guarantees mutual exclusion but fails to prevent deadlock
(C)
The proposed solution guarantees mutual exclusion and prevents deadlock
(D)
The proposed solution fails to prevent deadlock and fails to guarantee mutual exclusion
Answer (official key): A
Worked solution: in your report after you take this paper.
Q31 · Programming and Data Structures · MCQ · 1 mark
Consider the following array of elements:
⟨89,19,50,17,12,15,2,5,7,11,6,9,100⟩
The minimum number of interchanges needed to convert it into a max-heap is
(A)
4
(B)
5
(C)
2
(D)
3
Answer (official key): D
Worked solution: in your report after you take this paper.
Q32 · Programming and Data Structures · Numerical · 1 mark
Given a hash table T with 25 slots that stores 2000 elements, the load factor α for T is __________.
Answer (official key): 80
Worked solution: in your report after you take this paper.
Q33 · Databases · MCQ · 1 mark
Consider the relation X(P,Q,R,S,T,U) with the following set of functional dependencies:
F={{P,R}→{S,T},{P,S,U}→{Q,R}}
Which of the following is the trivial functional dependency in F+, where F+ is the closure of F?
(A)
{P,R}→{S,T}
(B)
{P,R}→{R,T}
(C)
{P,S}→{S}
(D)
{P,S,U}→{Q}
Answer (official key): C
Worked solution: in your report after you take this paper.
Q34 · Computer Networks · MCQ · 1 mark
Consider the following statements.
I. TCP connections are full duplex.
II. TCP has no option for selective acknowledgement.
III. TCP connections are message streams.
Which of the following is correct?
(A)
Only I is correct
(B)
Only I and III are correct
(C)
Only II and III are correct
(D)
All of I, II and III are correct
Answer (official key): A
Worked solution: in your report after you take this paper.
Q35 · Discrete Mathematics · MCQ · 1 mark
Suppose U is the power set of the set S={1,2,3,4,5,6}. For any T∈U, let ∣T∣ denote the number of elements in T and T′ denote the complement of T. For any T,R∈U, let T∖R be the set of all elements in T which are not in R.
Which one of the following is true?
(A)
∀X∈U(∣X∣=∣X′∣)
(B)
∃X∈U∃Y∈U(∣X∣=5,∣Y∣=5andX∩Y=∅)
(C)
∀X∈U∀Y∈U(∣X∣=2,∣Y∣=3andX∖Y=∅)
(D)
∀X∈U∀Y∈U(X∖Y=Y′∖X′)
Answer (official key): D
Worked solution: in your report after you take this paper.
Q36 · Operating System · MCQ · 2 marks
Consider the following policies for preventing deadlock in a system with mutually exclusive resources.
I. Processes should acquire all their resources at the beginning of execution. If any resource is not available, all resources acquired so far are released.
II. The resources are numbered uniquely, and processes are allowed to request resources only in increasing resource numbers.
III. The resources are numbered uniquely, and processes are allowed to request resources only in decreasing resource numbers.
IV. The resources are numbered uniquely. A process is allowed to request only for a resource with resource number larger than its currently held resources.
Which of the above policies can be used for preventing deadlock?
Consider a B+ tree in which the search key is 12 bytes long, block size is 1024 bytes, record pointer is 10 bytes long and block pointer is 8 bytes long. The maximum number of keys that can be accommodated in each non-leaf node of the tree is __________.
Answer (official key): 50
Worked solution: in your report after you take this paper.
Q40 · Computer Organization and Architecture · Numerical · 2 marks
Consider the following reservation table for a pipeline having three stages S1, S2 and S3.
Stage
Time 1
Time 2
Time 3
Time 4
Time 5
S1
X
X
S2
X
X
S3
X
The minimum average latency (MAL) is __________.
Answer (official key): 3
Worked solution: in your report after you take this paper.
Q41 · Algorithms · MCQ · 2 marks
Assume that a mergesort algorithm in the worst case takes 30 seconds for an input of size 64. Which of the following most closely approximates the maximum input size of a problem that can be solved in 6 minutes?
(A)
256
(B)
512
(C)
1024
(D)
2048
Answer (official key): B
Worked solution: in your report after you take this paper.
Q42 · Databases · MCQ · 2 marks
Consider the following partial schedule S involving two transactions T1 and T2. Only the read and write operations are shown. The read operation on data item P is denoted by read(P) and the write operation on data item P is denoted by write(P).
Time
T1
T2
1
read(A)
2
write(A)
3
read(C)
4
write(C)
5
read(B)
6
write(B)
7
read(A)
8
commit
9
read(B)
Suppose that transaction T1 fails immediately after time instance 9. Which one of the following statements is correct?
(A)
T2 must be aborted and then both T1 and T2 must be re-started to ensure transaction atomicity
(B)
Schedule S is non-recoverable and cannot ensure transaction atomicity
(C)
Only T2 must be aborted and then re-started to ensure transaction atomicity
(D)
Schedule S is recoverable and can ensure atomicity and nothing else needs to be done
Answer (official key): B
Worked solution: in your report after you take this paper.
Q43 · Theory of Computation · MCQ · 2 marks
Language L1 is polynomial-time reducible to language L2. Language L3 is polynomial-time reducible to L2, which in turn is polynomial-time reducible to language L4. Which of the following is/are true?
I. If L4∈P, then L2∈P
II. If L1∈P or L3∈P, then L2∈P
III. L1∈P if and only if L3∈P
IV. If L4∈P, then L1∈P and L3∈P
(A)
II only
(B)
III only
(C)
I and IV only
(D)
I only
Answer (official key): C
Worked solution: in your report after you take this paper.
Q44 · Computer Organization and Architecture · MCQ · 2 marks
Consider the following code sequence having five instructions I1 to I5. Each instruction has the following format:
OP Ri, Rj, Rk
where operation OP is performed on contents of registers Rj and Rk, and the result is stored in register Ri.
I1: ADD R1, R2, R3
I2: MUL R7, R1, R3
I3: SUB R4, R1, R5
I4: ADD R3, R2, R4
I5: MUL R7, R8, R9
Consider the following statements:
S1: There is an anti-dependence between instructions I2 and I5.
S2: There is an anti-dependence between instructions I2 and I4.
S3: Within an instruction pipeline, an anti-dependence always creates one or more stalls.
Which one of the above statements is/are correct?
(A)
Only S1 is true
(B)
Only S2 is true
(C)
Only S1 and S3 are true
(D)
Only S2 and S3 are true
Answer (official key): B
Worked solution: in your report after you take this paper.
Q45 · Discrete Mathematics · Numerical · 2 marks
Consider the equation
(43)x=(y3)8
where x and y are unknown. The number of possible solutions is __________.
Answer (official key): 5
Worked solution: in your report after you take this paper.
Q46 · Theory of Computation · MCQ · 2 marks
Which of the following languages are context-free?
Worked solution: in your report after you take this paper.
Q47 · Computer Networks · Numerical · 2 marks
In the network 200.10.11.144/27, the fourth octet in decimal of the last IP address of the network which can be assigned to a host is __________.
Answer (official key): 158
Worked solution: in your report after you take this paper.
Q48 · Calculus · MCQ · 2 marks
If for non-zero x,
af(x)+bf(x1)=x1−25,
where a=b, then
∫12f(x)dx
is
(A)
a2−b21[a(ln2−25)+247b]
(B)
a2−b21[a(2ln2−25)−247b]
(C)
a2−b21[a(2ln2−25)+247b]
(D)
a2−b21[a(ln2−25)−247b]
Answer (official key): A
Worked solution: in your report after you take this paper.
Q49 · Algorithms · Numerical · 2 marks
Suppose c=⟨c[0],…,c[k−1]⟩ is an array of length k, where all entries are from the set {0,1}. For any positive integers a and n, consider the following pseudocode.
DOSOMETHING(c,a,n)
z <- 1
for i <- 0 to k-1
do z <- z^2 mod n
if c[i] = 1
then z <- (z * a) mod n
return z
If k=4, c=⟨1,0,1,1⟩, a=2 and n=8, then the output of DOSOMETHING(c,a,n) is __________.
Answer (official key): 0
Worked solution: in your report after you take this paper.
Q50 · Computer Networks · Numerical · 2 marks
Two hosts are connected via a packet switch with 107 bits per second links. Each link has a propagation delay of 20 microseconds. The switch begins forwarding a packet 35 microseconds after it receives the same. If 10000 bits of data are to be transmitted between the two hosts using a packet size of 5000 bits, the time elapsed between the transmission of the first bit of data and the reception of the last bit of the data in microseconds is __________.
Answer (official key): 1575
Worked solution: in your report after you take this paper.
Q51 · Linear Algebra · MCQ · 2 marks
If the following system has non-trivial solution,
px+qy+rz=0qx+ry+pz=0rx+py+qz=0
then which one of the following options is TRUE?
(A)
p−q+r=0 or p=q=−r
(B)
p+q−r=0 or p=−q=r
(C)
p+q+r=0 or p=q=r
(D)
p−q+r=0 or p=−q=−r
Answer (official key): C
Worked solution: in your report after you take this paper.
Q52 · Algorithms · Numerical · 2 marks
Let G be a connected undirected graph of 100 vertices and 300 edges. The weight of a minimum spanning tree of G is 500. When the weight of each edge of G is increased by five, the weight of a minimum spanning tree becomes __________.
Answer (official key): 995
Worked solution: in your report after you take this paper.
Q53 · Digital Logic · Numerical · 2 marks
The total number of prime implicants of the function
f(w,x,y,z)=Σ(0,2,4,5,6,10)
is __________.
Answer (official key): 3
Worked solution: in your report after you take this paper.
Q54 · Digital Logic · MCQ · 2 marks
Given the function
F=P′+QR,
where F is a function in three Boolean variables P,Q,R and P′=¬P, consider the following statements:
Worked solution: in your report after you take this paper.
Q55 · Programming and Data Structures · Numerical · 2 marks
Consider the following C program.
#include <stdio.h>
int main()
{
int i, j, k = 0;
j = 2 * 3 / 4 + 2.0 / 5 + 8 / 5;
k -= --j;
for (i = 0; i < 5; i++)
{
switch(i + k)
{
case 1:
case 2: printf("\n%d", i+k);
case 3: printf("\n%d", i+k);
default: printf("\n%d", i+k);
}
}
return 0;
}
The number of times printf statement is executed is __________.
Answer (official key): 10
Worked solution: in your report after you take this paper.
Q56 · Algorithms · MCQ · 2 marks
Let f(n)=n and g(n)=n(1+sinn), where n is a positive integer. Which of the following statements is/are correct?
I. f(n)=O(g(n))
II. f(n)=Ω(g(n))
(A)
Only I
(B)
Only II
(C)
Both I and II
(D)
Neither I nor II
Answer (official key): D
Worked solution: in your report after you take this paper.
Q57 · Operating System · MCQ · 2 marks
For the processes listed in the following table, which of the following scheduling schemes will give the lowest average turnaround time?
Process
Arrival Time
Processing Time
A
0
3
B
1
6
C
4
4
D
6
2
(A)
First Come First Serve
(B)
Non-preemptive Shortest Job First
(C)
Shortest Remaining Time
(D)
Round Robin with Quantum value two
Answer (official key): C
Worked solution: in your report after you take this paper.
Q58 · Programming and Data Structures · Numerical · 2 marks
Consider the following C program.
#include <stdio.h>
int main()
{
static int a[] = {10, 20, 30, 40, 50};
static int *p[] = {a, a+3, a+4, a+1, a+2};
int **ptr = p;
ptr++;
printf("%d%d", ptr-p, **ptr);
}
The output of the program is __________.
Answer (official key): 140
Worked solution: in your report after you take this paper.
Q59 · Computer Networks · Numerical · 2 marks
Consider a network connecting two systems located 8000 kilometers apart. The bandwidth of the network is 500×106 bits per second. The propagation speed of the media is 4×106 meters per second. It is needed to design a Go-Back-N sliding window protocol for this network. The average packet size is 107 bits. The network is to be used to its full capacity. Assume that processing delays at nodes are negligible.
Then, the minimum size in bits of the sequence number field has to be __________.
Answer (official key): 8
Worked solution: in your report after you take this paper.
Q60 · Programming and Data Structures · MCQ · 2 marks
If get(6) is called in main(), then how many times will the get() function be invoked before returning to main()?
(A)
15
(B)
25
(C)
35
(D)
45
Answer (official key): B
Worked solution: in your report after you take this paper.
Q61 · Programming and Data Structures · Numerical · 2 marks
Consider the following C program.
#include <stdio.h>
int f1(void);
int f2(void);
int f3(void);
int x = 10;
int main()
{
int x = 1;
x += f1() + f2() + f3() + f2();
printf("%d", x);
return 0;
}
int f1() { int x = 25; x++; return x; }
int f2() { static int x = 50; x++; return x; }
int f3() { x *= 10; return x; }
The output of the program is __________.
Answer (official key): 230
Worked solution: in your report after you take this paper.
Q62 · Computer Organization and Architecture · MCQ · 2 marks
Consider the following two C code segments. Y and X are one and two dimensional arrays of size n and n×n respectively, where 2≤n≤10. Assume that in both code segments, elements of Y are initialized to 0 and each element X[i][j] of array X is initialized to i+j. Further assume that when stored in main memory, all elements of X are in the same main memory page frame.
Code segment 1:
for (i = 0; i < n; i++)
Y[i] += X[0][i];
Code segment 2:
for (i = 0; i < n; i++)
Y[i] += X[i][0];
Which of the following statements is/are correct?
S1: Final contents of array Y will be same in both code segments.
S2: Elements of array X accessed inside the loop shown in code segment 1 are contiguous in main memory.
S3: Elements of array X accessed inside the loop shown in code segment 2 are contiguous in main memory.
(A)
Only S2 is correct
(B)
Only S3 is correct
(C)
Only S1 and S2 are correct
(D)
Only S1 and S3 are correct
Answer (official key): C
Worked solution: in your report after you take this paper.
Q63 · Discrete Mathematics · MCQ · 2 marks
Let R be a relation on the set of ordered pairs of positive integers such that ((p,q),(r,s))∈R if and only if p−s=q−r. Which one of the following is true about R?
(A)
Both reflexive and symmetric
(B)
Reflexive but not symmetric
(C)
Not reflexive but symmetric
(D)
Neither reflexive nor symmetric
Answer (official key): C
Worked solution: in your report after you take this paper.
Q64 · Calculus · Numerical · 2 marks
The velocity v in kilometer/minute of a motorbike which starts from rest is given at fixed intervals of time t in minutes as follows:
t
2
4
6
8
10
12
14
16
18
20
v
10
18
25
29
32
20
11
5
2
0
The approximate distance in kilometers rounded to two places of decimal covered in 20 minutes using Simpson’s 1/3 rule is __________.
Answer (official key): 308 to 310
Worked solution: in your report after you take this paper.
Q65 · Programming and Data Structures · MCQ · 2 marks
Consider three software items: Program-X, Control Flow Diagram of Program-Y and Control Flow Diagram of Program-Z as shown below.
The values of McCabe’s cyclomatic complexity of Program-X, Program-Y, and Program-Z respectively are:
(A)
4, 4, 7
(B)
3, 4, 7
(C)
4, 4, 8
(D)
4, 3, 8
Answer (official key): A
Worked solution: in your report after you take this paper.