id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

tmhscs@gmail.com competition > UIL2015_INVA_05_FACTORIAL
prev  |  next  |  chance

A factorial of a non-negative integer is obtained by multiplying it by each of the non-negative integers leading up to it. For example, 4-factorial, also written as 4!, is equal to 1 x 2 x 3 x 4 = 24. Factorials become very large very quickly. Here are two examples:

10! = 3628800

100! = 933262154439441526816992388562667004907159682643816214685929638952175999932299 156089414639761565182862536979208272237582511852109168640000000000000000000000 00

The number of trailing zeroes for 10! is 2. The number of trailing zeroes for 100! is 24. In this problem, you will be given some number n, and you will determine the number of trailing zeroes for n-factorial.


UIL2015_INVA_05_FACTORIAL(5) → 1
UIL2015_INVA_05_FACTORIAL(6) → 1
UIL2015_INVA_05_FACTORIAL(7) → 1

...Save, Compile, Run (ctrl-enter)

public int UIL2015_INVA_05_FACTORIAL(int n) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Post-solution available

Copyright Nick Parlante 2017 - privacy