MCPcopy Index your code
hub / github.com/Hazrat-Ali9/Computer-Programming / getFactorial

Method getFactorial

Problem16.java:9–20  ·  view source on GitHub ↗
(int number)

Source from the content-addressed store, hash-verified

7public class Problem16 {
8
9 public static int getFactorial(int number) {
10 int factorial = 1;
11
12 if (number == 0 || number == 1) {
13 return factorial;
14 } else {
15 for (int i = number; i >= 1; i--) {
16 factorial = factorial * i;
17 }
18 return factorial;
19 }
20 }
21
22 public static void main(String[] args) {
23 // TODO Auto-generated method stub

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected