TLE in Small Factorial.......Why?

http://www.codechef.com/viewsolution/6589228

See this your code enters an infinite loop during calculating FACT(10) due to which you are getting TLE:

try changing the printing loop its not working on ideone although its working fine on my compiler http://ideone.com/XiZDCp
this is the corrected code

Thanks a lot…:))

Thanks a lot…:))

i find problem in looping… I think you have created unnecessary nested loop while calculating for temp and trying to store it in a[m++].

i find problem in looping… I think you have created unnecessary nested loop while calculating for temp and trying to store it in a[m++].