def baal(int jjj) { | |
while (true) | |
println(<selection>fact</selection>(jjj)) | |
} | |
int fact(int n) { | |
if (n > 0) { | |
return n * fact(n - 1) | |
} | |
else return 1 | |
} | |
----- | |
def baal(int jjj) { | |
while (true) { | |
int result | |
if (jjj > 0) { | |
result = jjj * fact(jjj - 1) | |
} else result = 1 | |
println(result) | |
} | |
} | |
int fact(int n) { | |
if (n > 0) { | |
return n * fact(n - 1) | |
} | |
else return 1 | |
} |