1
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 ______.
2
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 _____.
3
GATE CSE 2015 Set 2
+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
4
GATE CSE 2015 Set 3
+1
-0.3
Consider the following C program segment.
#include < stdio.h >
int main()
{
char s1[7] = "1234", *p;
p = s1 + 2;
*p = ‘0’;
printf("%s", s1);
}
What will be printed by the program?
A
12
B
120400
C
1204
D
1034
GATE CSE Subjects
EXAM MAP
Medical
NEET