1
GATE CSE 2004
MCQ (Single Correct Answer)
+1
-0.3
Consider the following C function:
void swap (int a, int b)
{
   int temp;
   temp = a;
   a = b;
   b = temp;
}
In order to exchange the values of two variables x and y.
A
call swap (x, y)
B
call swap (&x, &y)
C
swap (x, y) cannot be used as it does return any value
D
swap (x, y) cannot be used as the parameters are passed by value
2
GATE CSE 2004
MCQ (Single Correct Answer)
+2
-0.6
Consider the following C program segment:
char p[20];
char *s = "string";
int length = strlen(s);
for(i=0; i < length; i++)
  p[i] = s[length-i];
printf("%s",p);
The output of the program is
A
gnirts
B
string
C
gnirt
D
no output is printed
3
GATE CSE 2004
MCQ (Single Correct Answer)
+2
-0.6
The following finite state machine accepts all those binary strings in which the number of $$1's$$ and $$0's$$ are respectively GATE CSE 2004 Theory of Computation - Finite Automata and Regular Language Question 25 English
A
Divisible by $$3$$ and $$2$$
B
Odd and even
C
Even and odd
D
Divisible by $$2$$ and $$3$$
4
GATE CSE 2004
MCQ (Single Correct Answer)
+1
-0.3
Which of the following grammar rules violate the requirements of an operator grammar ? $$P,$$ $$Q, R$$ are non-terminals and $$r, s, t$$ are terminals. $$$\eqalign{ & 1)\,\,\,P \to Q\,R\,\,\,\,\,2)\,\,\,P \to Q\,s\,R \cr & 3)\,\,\,P \to c\,\,\,\,\,\,\,\,\,\,\,4)P \to Q\,t\,R\,r \cr} $$$
A
$$(1)$$ only
B
$$(1)$$ and $$(3)$$ only
C
$$(2)$$ and $$(3)$$ only
D
$$(3)$$ and $$(4)$$ only
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12