Examveda

Consider the following recursive implementation to find the factorial of a number. Which of the lines should be inserted to complete the below code?
int fact(int n)
{
     if(_________)
        return 1;
     return n * fact(n - 1);
}
int main()
{
      int n = 5;
      int ans = fact(n);
      printf("%d",ans);
      return 0;
}

A. n = 0

B. n != 0

C. n == 0

D. n == 1

Answer: Option C


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

Join The Discussion

Related Questions on Miscellaneous on Data Structures