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

 

norm.krumpe@muohio.edu > factorial
prev  |  next  |  chance

Compute the factorial of a number. For example, factorial(5) = 5 * 4 * 3 * 2 * 1. Note: factorial(0) is defined as 1. Note that this method returns a value of type long.


factorial(5) → 120
factorial(0) → 1
factorial(8) → 40320

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

long factorial(int num) { }

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

Difficulty: 100

Copyright Nick Parlante 2017 - privacy