GATE Computer Science (CS) 2017 Shift 1 Solved Paper

© examsiri.com
Question : 46 of 65
 
Marks: +1, -0
Consider the C functions foo and bar given below:
Int foo (int val) {
int x = 0;
while (val  > 0)
x = x + foo (val --);
}
return val;
}
int bar (int val) {
int x = 0;
while (val > 0) {
x = x + bar (val – 1);
}
return val;
}

Invocations of foo (3) and bar (3) will result in:
Go to Question: