Do like this:
public int formulaMethod(int n) {
int result = 1;
for (int i = 1; i <= n; i++) {
result *= i;
}
return result;
}
Hope it helps
0
solved Java Math Formula Loops
Do like this:
public int formulaMethod(int n) {
int result = 1;
for (int i = 1; i <= n; i++) {
result *= i;
}
return result;
}
Hope it helps
0
solved Java Math Formula Loops