When you refer to quantitative aptitude there is a short formula for calculating the number of trailing zeroes for any factorial number. Check SPOJ forum to see whether there are hints posted already 3. In order to find factorial of n and number zeros at the end of factorial decimal. It real. #include