asked 21 Sep '14, 23:30

your algorithm is true only up to certain factorial like 19 after that overflow occurs and thus you encounter wrong answer, this is implemented using arrays storing each digit in an array, for eg: 123 can be stored in an array as a[0]=3,a1=2,a[2]=1 and so on... there is a tutorial to solve this problem. you can look at this tutorial to solve this problem. if you have any doubts after looking at this tutorial comment below. happy coding :) answered 21 Sep '14, 23:55
1
I would like to suggest... http://discuss.codechef.com/questions/7349/computingfactorialsofahugenumberinccatutorial ...this is a very good tutorial written by @kuruma!!!
(21 Sep '14, 23:59)
