Gate 2018 pyq C Programming | Consider the following C program: int counter= 0;int calc(int a,int b)

Опубликовано: 29 Апрель 2026
на канале: Gate CS pyqs - the other way [Eng]
330
19

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