1
GATE CSE 2021 Set 2
Numerical
+1
-0

Consider the following ANSI C function:

int SomeFunction (int x, int y)

{

if ( (x == 1) I I (y == 1)) return 1;

if (x == y) return x;

if (x > y) return SomeFunction(x - y, y);

if (y > x) return SomeFunction(x, y - x);

}

The value returned by SomeFunction(15, 255) is _______.

Your input ____
2
GATE CSE 2019
Numerical
+1
-0.33
Consider the following C program:

        #include < stdio.h >
         int jumble (int x, int y)  {
               x = 2 * x + y ;
               return x ;
         }
         int main ( )  {
               int x=2, y=5 ;
               y = jumble (y, x) ;
               x = jumble (y, x) ;
               printf ("%d \n", x) ;
               return 0 ;
         }


The value printed by the program is ______.
Your input ____
3
GATE CSE 2018
Numerical
+1
-0
Consider the following C program:
#include < stdio.h >
  int counter = 0;
  int calc (int a, int b) {
  int c;
  counter++;
  if (b==3) return (a*a*a);
  else {
    c = calc(a, b/3);
    return (c*c*c);
 }
}
int main (){
  calc(4, 81);
  printf ("%d", counter);
}
The output of this program is _____.
Your input ____
4
GATE CSE 2015 Set 2
MCQ (Single Correct Answer)
+1
-0.3
Consider the following function written in the C programming language.
void foo(char *a){
 if ( *a && *a != ' '){
     foo(a+1);
     putchar(*a);
   }
}
The output of the above function on input “ABCD EFGH” is
A
ABCD EFGH
B
ABCD
C
HGFE DCBA
D
DCBA
GATE CSE Subjects
Software Engineering
Web Technologies
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