What will be the output of the following code? [code] int cnt=0; void my_recursive_function(int n) { if(n == 0) return;

What will be the output of the following code?
Code:
int cnt=0;
void my_recursive_function(int n)
{
     if(n == 0)
     return;
     cnt++;
     my_recursive_function(n/10);
}
int main()
{
     my_recursive_function(123456789);
     printf("%d",cnt);
     return 0;
}
A. 123456789
B. 10
C. 0
D. 9
 

Tìm kiếm

Back
Top