remove redundant code
This commit is contained in:
1 file changed
-4
@@ -46,9 +46,6 @@ public class Factorial {
|
||||
|
||||
int number = readPositiveInt();
|
||||
|
||||
if (number == 0) {
|
||||
System.out.println("The factorial of 0 is 1.");
|
||||
} else {
|
||||
int product = 1;
|
||||
for (int i = 2; i <= number; i++) {
|
||||
product *= i;
|
||||
@@ -58,5 +55,4 @@ public class Factorial {
|
||||
+ product + "."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user