Vidyalelo
Data Structure · Q1074

Miscellaneous on Data Structures

Programming · Data Structure · question 1074

Q1074

What is the output of the following code? int fact(int n) if(n == 0) return 1; return n * fact(n - 1); int main() int n = 5; int ans = fact(n); printf("%d",ans); return 0;

A.
24
B.
120
Answer
C.
720
D.
1

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board