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 ________ .

Correct : a

Similar Questions

Consider the following C functions. int tob (int b, int* arr) { &nbsp; &nbsp; int i; &nbsp; &nbsp; for (i = 0; b>0; i++) { &nbsp; &nbsp; if (b%2) &nbsp; &nbs...
#637 Fill in the Blanks
Consider the following C functions. int tob (int b, int* arr) { &nbsp; &nbsp; int i; &nbsp; &nbsp; for (i = 0; b>0; i++) { &nbsp; &nbsp; if (b%2) &nbsp; &nbs...
#637 Fill in the Blanks
Consider the following C functions. int tob (int b, int* arr) { &nbsp; &nbsp; int i; &nbsp; &nbsp; for (i = 0; b>0; i++) { &nbsp; &nbsp; if (b%2) &nbsp; &nbs...
#637 Fill in the Blanks

Related Topics

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......