Q36
MCQ2 marks, −0.67ProgrammingMediumConsider 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 and will result in:
Sign in to save attempts.
Keys: A–D or 1–4 choose, Enter checks, ← → move between questions.
Solutions and discussion are hidden while you attempt this question. They open once you check or show the answer.