my code giving error - "wrong answer"

I attempted question- small factorials (FCTRL2)( FCTRL2 Problem - CodeChef ) - but my code is giving wrong answer error and I cant get the error in my code … plz suggest how i can modify my code … my code is CodeChef: Practical coding for everyone

see here:

output seems to be 12 every time (would have been funnier if 42 kept coming out though)

A few ideas:
Break the problem down a little - your code is too interdependent on tracking variables like siz which are doing too many things. This is going to make debugging very hard.
See my code CodeChef: Practical coding for everyone, its not important whether you understand it (or rate it at all) but notice that I’ve broken the problem down so that I can test each part of the code separately. I also wrote it using a top down approach. I wrote the function factorial first, including the use of helper functions I hadn’t written yet, and then wrote the sub-functions after to make the code feel natural as possible.

Also, get out of the habit of using cin/cout for input/output. It doesn’t matter so much on this problem but your going to run into time exceeds on other problems if you don’t learn about scanf/printf in the library, which are quicker.

ok, the link i gave didn’t work (try pvKQIF - Online C++ Compiler & Debugging Tool - Ideone.com) but just play about on ideone.com and you’ll see what I mean