How To Exam?

a knowledge trading engine...


Uttar Pradesh Technical University (UPTU) 2006 B.Tech Computer Science Information Technology GATE - Question Paper

Wednesday, 27 March 2013 07:45Web
mt x = a[i+2]; mt ti =
a[j] = x+1; mt t2 = a[tl];
return a[i+2] — 3; a[j] = t2+1;
return t2 — 3;
Si: The transformation form worki to work2 is valid, i.e., for any program state and input
arguments, work2 will calculate the identical output and have the identical effect on program state
as worki
S2: All the transformations applied to worki to get work2 will always improve the
performance (i.e decrease CPU time) of work2 compared to worki
(A) Si is false and S2 is false
(B) Si is false and S2 is actual
(C) Si is actual and S2 is false
(D) Si is actual and S2 is actual
56. Consider the subsequent code written in a pass-by-reference language like
FORTRAN and these statements about the code.
subroutine swap(ix,iy)
it = ix
Li: ix=iy
L2: iy=it
end
ia = 3
ib = 8
call swap (ia, ib+5)
print , ia, ib
end
Si: The compiler will generate code to allocate a temporary nameless cell, initialize it to i3,
and pass the address of the cell swap
S2: On execution the code will generate a runtime fault on line Li
S3: On execution the code will generate a runtime fault on line L2
S4: The program will print i3 and 8
S5: The program will print i3 and -2
Exactly the subsequent set of statement(s) is correct:
(A) Si and S2
(B) Si and S4

(C) S3
(D) Si and S5
57. Consider this C code to swap 2 integers and these 5 statements: the code
void swap (mt *px, mt *py) {
*px = *px - *py;
*py = *px + *py;
*px = *py - *px;
}
Si: will generate a compilation fault
S2: may generate a segmentation fault at runtime depending on the arguments passed
S3: correctly implements the swap procedure for all input pointers referring to integers stored
in memory locations accessible to the process
S4: implements the swap procedure correctly for a few but not all valid input pointers
S5: may add or subtract integers and pointers.
(A) Si
(B) S2 and S3
(C) S2 and S4
(D) S2 and S5
58. Consider the subsequent grammar:
S - FR
R — *5k.
F - Id
In the predictive parser table, M, of the grammar the entries M[S,idl and M[R,$1 respectively.
(A) {S—FR} and {R—s}
(B) {S—FR} and { }
(C) {S—FR} and {R_*S}
(D) {F — id} and {R — s}
59. Consider the subsequent translation scheme.



( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Uttar Pradesh Technical University (UPTU) 2006 B.Tech Computer Science Information Technology GATE - Question Paper