Computer Sciences > Gate 2018 > Function
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 ________ .

Explanation

Correct : a

Similar Questions

What is the worst-case time complexity of insertion in an AVL tree?
Question #23 Medium
Which operations on a binary search tree have O(h) complexity?
Question #31 Easy
Compare search complexities of sorted array vs balanced BST.
Question #47 Hard

Related Topics

Data Structures Binary Search Tree Time Complexity Algorithm Analysis Tree Algorithms Computer Science