1
GATE CSE 2024 Set 1
MCQ (Single Correct Answer)
+1
-0.33

Consider the following C program:


#include <stdio.h>
void fX();
int main() {
   fX();
   return 0;}


void fX() {
   char a;
   if ((a = getchar()) != '\n')
       fX();
   if (a != '\n')
       putchar(a);}

Assume that the input to the program from the command line is 1234 followed by a newline character. Which one of the following statements is CORRECT?

A

The program will not terminate

B

The program will terminate with no output

C

The program will terminate with 4321 as output

D

The program will terminate with 1234 as output

2
GATE CSE 2024 Set 1
MCQ (More than One Correct Answer)
+2
-0.66

Consider the following C function definition.

int f(int x, int y) {
    for (int i=0; i<y; i++) {
        x=x+x+y;
    }
    return x;
}

Which of the following statements is/are TRUE about the above function?

A

If the inputs are x=20, y=10, then the return value is greater than 220

B

If the inputs are x=20, y=20, then the return value is greater than 220

C

If the inputs are x=20, y=10, then the return value is less than 210

D

If the inputs are x=10, y=20, then the return value is greater than 220

3
GATE CSE 2024 Set 1
MCQ (More than One Correct Answer)
+1
-0.33

Let $L_1, L_2$ be two regular languages and $L_3$ a language which is not regular. Which of the following statements is/are always TRUE?

A

$L_1 = L_2$ if and only if $L_1 \cap \overline{L_2} = \emptyset$

B

$L_1 \cup L_3$ is not regular

C

$\overline{L_3}$ is not regular

D

$L_1 \cup \overline{L_2}$ is regular

4
GATE CSE 2024 Set 1
MCQ (More than One Correct Answer)
+2
-0.66

Consider the 5-state DFA $M$ accepting the language $L(M) \subseteq (0+1)^*$ shown below. For any string $w \in (0+1)^*$ let $n_0(w)$ be the number of 0's in $w$ and $n_1(w)$ be the number of 1's in $w$.

GATE CSE 2024 Set 1 Theory of Computation - Finite Automata and Regular Language Question 5 English

Which of the following statements is/are FALSE?

A

States 2 and 4 are distinguishable in $M$

B

States 3 and 4 are distinguishable in $M$

C

States 2 and 5 are distinguishable in $M$

D

Any string $w$ with $n_0(w) = n_1(w)$ is in $L(M)$

EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12