GATEverse Practice, past papers & mock tests
GATE 2018
Programming & Data StructuresProgrammingeasyNAT1 mark
Consider the following C program:
c
#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);
    return 0;
}
The output of this program is _______
Save your progress

Related Programming & Data Structures PYQs