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

 

andersoniii.edwin@cusd80.com > factorial
prev  |  next  |  chance

Factorial! Write a method to calculate the factorial of a given integer value as an input. Your method will return the integer factorial product. Example 5 -> 120 -- remember 0! by definition is equal to ONE (There will be no negative numbers as a parameter)


factorial(0) → 1
factorial(1) → 1
factorial(2) → 2

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

public int 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 Post-solution available

Copyright Nick Parlante 2017 - privacy