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

What is printed by the following ANSI C program?


#include <stdio.h>
int main(int argc, char *argv[ ]) {
   int x = 1, z[2] = {10, 11};
   int *p = NULL;
   p = &x;
   *p = 10;
   p = &z[1];
   *(&z[0] + 1) += 3;
   printf("%d, %d, %d\n", x, z[0], z[1]);
   return 0;
} 

A
1, 10, 11
B
1, 10, 14
C
10, 14, 11
D
10, 10, 14
2
GATE CSE 2022
MCQ (Single Correct Answer)
+2
-0.67

What is printed by the following ANSI C program?


  #include <stdio.h>
  int main(int argc, char *argv[ ]) {
    int a[3][3][3] = {{1, 2, 3, 4, 5, 6, 7, 8, 9},
        {10, 11, 12, 13, 14, 15, 16, 17, 18},
        {19, 20, 21, 22, 23, 24, 25, 26, 27}};
    int i = 0, j = 0, k = 0;
    for(i = 0; i < 3; i++) {
        for(k = 0; k < 3; k++)
              printf("%d"",a[i][j][k]);
        printf("\n");
    }
   return 0;
   }

A
$$\matrix{ 1 & 2 & 3 \cr {10} & {11} & {12} \cr {19} & {20} & {21} \cr } $$
B
$$\matrix{ 1 & 4 & 7 \cr {10} & {13} & {16} \cr {19} & {22} & {25} \cr } $$
C
$$\matrix{ 1 & 2 & 3 \cr 4 & 5 & 6 \cr 7 & 8 & 9 \cr } $$
D
$$\matrix{ 1 & 2 & 3 \cr {13} & {14} & {15} \cr {25} & {26} & {27} \cr } $$
3
GATE CSE 2022
MCQ (Single Correct Answer)
+2
-0.67

What is printed by the following ANSI C program?


 #include <stdio.h>
 int main(int argc, char *argv[]) {
    char a = 'P';
    char b = 'x';
    char c = (a & b) + '*';
    char d = (a | b) - '-';
    char e = (a ^ b) + '+';
    printf("%c %c %c\n", c, d, e);
    return 0;
 }

ASCII encoding for relevant characters is given below :

GATE CSE 2022 Programming Languages - Basic of Programming Language Question 4 English

A
z K S
B
122 75 83
C
* $$-$$ +
D
P x +
4
GATE CSE 2022
MCQ (Single Correct Answer)
+1
-0.33

Which one of the following regular expressions correctly represents the language of the finite automation given below?

GATE CSE 2022 Theory of Computation - Finite Automata and Regular Language Question 11 English

A
ab*bab* + ba*aba*
B
(ab*b)* ab* + (ba*a)*ba*
C
(ab*b + ba*a)* (a* + b*)
D
(ba*a + ab*b)* (ab* + ba*)
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