0

how to find a factorial of a number?

15th Jun 2017, 2:41 PM
Vikas Sharma
Vikas Sharma - avatar
5 Answers
15th Jun 2017, 2:48 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 6
https://code.sololearn.com/cjaInE3bgRqx/?ref=app
15th Jun 2017, 11:29 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
15th Jun 2017, 2:58 PM
Nanda Balakrishnan
+ 1
Hi, Recursion, however, is costly in terms of efficiency. It's basically a function call, which in itself is expensive compared to looping. It involves complex push and pop operations on the stack. A loop on the other hand is much more efficient as it doesn't involve as much overhead. so avoid recursive function. if I am wrong pls correct me.
15th Jun 2017, 4:53 PM
Nanda Balakrishnan