Examveda

What will be the output of the following 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

Answer: Option D


This Question Belongs to Data Structure >> Miscellaneous On Data Structures

Join The Discussion

Related Questions on Miscellaneous on Data Structures