20 lines
300 B
Java
20 lines
300 B
Java
public class TestLoop {
|
|
public int factorial(int n)
|
|
{
|
|
int tally = 1;
|
|
for(int i = 1; i <= n; i++)
|
|
{
|
|
tally *= i;
|
|
}
|
|
|
|
return tally;
|
|
}
|
|
|
|
int weirdFor() {
|
|
int k = 0;
|
|
for (; k < 5; k++) {
|
|
}
|
|
return k;
|
|
}
|
|
}
|