1
GATE CSE 2020
Numerical
+2
-0.67
Consider the following C functions.
int tob(int b, int* arr) {
     int i;
     for (i=0; b>0; i++) {
           if (b%2) arr[i] = 1;
           else arr[i]=0;
           b = b/2;
    }
    return (i);
}

____________________
int pp(int a, int b) {
     int arr[20];
     int i, tot = 1, ex, len;
     ex = a;
     len = tob (b, arr);
     for (i=0;  i < len; i++) {
           if (arr[i] ==1)
              tot = tot * ex;
           ex = ex * ex;
    }
    return (tot);
}

The value returned by pp (3, 4) is ________.
Your input ____
2
GATE CSE 2020
Numerical
+2
-0.67
Consider the following C functions.
int fun1 (int n) {
     static int i = 0;
     if (n > 0) {
            ++i;
            fun1(n-1);
     }
     return (i);
}

___________________
int fun2 (int n) {
     static int i = 0;
     if (n > 0) {
            i = i + fun1 (n);
            fun2(n-1);
     }
     return (i);
}

The return value of fun2 (5) is _______.
Your input ____
3
GATE CSE 2020
MCQ (Single Correct Answer)
+1
-0.33
Consider the following statements.

I. If L1 $$ \cup $$ L2 is regular, then both L1 and L2 must be regular.
II. The class of regular languages is closed under infinite union.

Which of the above statements is/are TRUE?
A
I only
B
II only
C
Both I and II
D
Neither I nor II
4
GATE CSE 2020
MCQ (Single Correct Answer)
+1
-0.33
Which one of the following regular expressions represents the set of all binary strings with an odd number of 1’s?
A
10*(0*10*10*)*
B
((0 + 1)*1(0 + 1)*1)*10*
C
(0*10*10*)*10*
D
(0*10*10*)*0*1
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12