1
GATE CSE 2003
MCQ (Single Correct Answer)
+2
-0.6
The following program fragment is written in a programming language that allows global variables and does not allow nested declarations of functions.
global int i = 100, j = 5;
void P(x) {
    int i = 10;
    print(x + 10);
    i = 200;
    j = 20;
    print (x);
}
main() {
    P(i + j);
}
If the programming language uses dynamic scoping and call by name parameter passing mechanism, the values printed by the above program are
A
115, 220
B
25, 220
C
25, 15
D
115, 105
2
GATE CSE 2003
MCQ (Single Correct Answer)
+1
-0.3
Consider the following C function.
float f,(float x, int y) {
    float p, s; int i;
    for (s=1,p=1,i=1; i < y; i++) {
         p *= x/i;
         s+=p;
    }
return s;
}
For large values of y, the return value of the function f best approximates
A
Xy
B
ex
C
$$\ln (1 + x)$$
D
Xx
3
GATE CSE 2003
MCQ (Single Correct Answer)
+2
-0.6
A single tape Turing Machine $$M$$ has two states $${q_0}$$ and $${q_1}$$, of which $${q_0}$$ is the starting state. The tape alphabet of $$M$$ is $$\left\{ {0,\,\,1,\,\,B} \right\}$$ and its input alphabet is $$\left\{ {0,\,\,1} \right\}$$. The symbol $$B$$ is the blank symbol used to indicate end of an input string. The transition function of $$M$$ is described in the following table. GATE CSE 2003 Theory of Computation - Recursively Enumerable Language and Turing Machine Question 24 English

The table is interpreted as illustrated below. The entry $$\left( {{q_1},1,\,R} \right)$$ in row $${{q_0}}$$ and column $$1$$ signifies that if $$M$$ is in state $${{q_0}}$$ and reads $$1$$ on the current tape square, then it writes $$1$$ on the same tape square, moves its tape head one position to the right and transitions to state $${{q_1}}$$.

Which of the following statements is true about $$M?$$

A
$$M$$ does not halt on any string in $${\left( {0 + 1} \right)^ + }$$
B
$$M$$ does not halt on any string in $${\left( {00 + 1} \right)^ + }$$
C
$$M$$ halts on all string ending in a $$0$$
D
$$M$$ halts on all string ending in $$a$$
4
GATE CSE 2003
MCQ (Single Correct Answer)
+2
-0.6
Consider the $$NFA$$ $$M$$ shown below. GATE CSE 2003 Theory of Computation - Finite Automata and Regular Language Question 50 English

Let the language accepted by $$M$$ be $$L.$$ Let $${L_1}$$ be the language accepted by the $$NFA$$, $${M_1}$$ obtained by changing the accepting state of $$M$$ to a non accepting state and by changing the non accepting state of $$M$$ to accepting states. Which of the following statements is true?

A
$${L_1} = \left\{ {0,\,1} \right\}{}^ * - L$$
B
$${L_1} = \left\{ {0,\,1} \right\}{}^ * $$
C
$${L_1} \subseteq \,L$$
D
$${L_1} = \,L$$