GATE 2018 Previous Year Paper Solution Question 21 :- Computer Science
In this video question which was asked in the exam of GATE 2018 is discussed.
Question :- # 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 the program is _________ .
The solution is given in the video.