1
GATE CSE 2012
+2
-0.6
Consider the following C code segment.
int a, b, c = 0;
void prtFun(void);
main( )
{
static int a = 1; /* Line 1 */
prtFun();
a + = 1;
prtFun();
printf("\n %d %d ", a, b);
}
void prtFun(void)
{
static int a=2;   /* Line 2 */
int b=1;
a+ = ++b;
printf("\n %d %d ", a, b);
}
What output will be generated by the given code segment if:
Line 1 is replaced by auto int a = 1;
Line 2 is replaced by register int a = 2;
A
\eqalign{ & 3\,\,1 \cr & 4\,\,1 \cr & 4\,\,2 \cr}
B
\eqalign{ & 4\,\,2 \cr & 6\,\,1 \cr & 6\,\,1 \cr}
C
\eqalign{ & 4\,\,2 \cr & 6\,\,2 \cr & 2\,\,0 \cr}
D
\eqalign{ & 4\,\,2 \cr & 4\,\,2 \cr & 2\,\,0 \cr}
2
GATE CSE 2012
+1
-0.3
What is the complement of the language accepted by the $$NFA$$ shown below?
Assume $$\sum { = \left\{ a \right\}\,\,}$$ and $$\varepsilon$$ is the empty string.
A
$$\phi$$
B
$$\left\{ \varepsilon \right\}$$
C
$$a{}^ *$$
D
$$\left\{ {a,\,\,\varepsilon } \right\}$$
3
GATE CSE 2012
+2
-0.6
Consider the set of strings on $$\left\{ {0,1} \right\}$$ in which, every substring of $$3$$ symbols has at most two zeros. For example, $$001110$$ and $$011001$$ are in the language, but $$100010$$ is not. All strings of length less than $$3$$ are also in the language. A partially completed $$DFA$$ that accepts this language is shown below.

The missing arcs in the $$DFA$$ are

A
B
C
D
4
GATE CSE 2012
+1
-0.3
Which of the following problems are decidable?
$$1.$$ Does a given program ever produce an output?
$$2.$$ If L is a context-free language, then, is $$\overline L$$ also context-free?
$$3.$$ If L is a regular language, then, is $$\overline L$$ also regular?
$$4.$$ If L is a recursive language, then, is $$\overline L$$ also recursive?
A
$$1, 2,3,4$$
B
$$1,2$$
C
$$2,3,4$$
D
$$3,4$$
GATE CSE Papers
2023
2022
2020
2019
2018
2013
2012
2011
2010
2009
2008
2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997
1996
1995
1994
1993
1992
1991
1990
1989
1988
1987
EXAM MAP
Medical
NEET