[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C Programming :: Functions - Discussion

Home > C Programming > Functions > MCQs Questions Discussion

3 / 53

What is the output of the following problem ?

#include<stdio.h>

int main() {
int factorial(int n);
int i,ans;
ans = factorial(5);
printf("\nFactorial by recursion  = %d\n", ans);
return 0;
}
int factorial(int n)
{
if (n <= 1)
return (1);
else
return ( n * factorial(n-1));
}

A120

B5

C1

DNoneof these

Answer: Option (Login/Signup)

Show Explanation

Asked In :: SAP Labs

Post Your Answer Here:     

No Discussion on this question yet!