Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ExMy01MethodFactorialQuestion {
- public static void main(String[] args) {
- int a = 5;
- int f = getFctrl(a);
- System.out.println(f);
- }
- public static int getFctrl(int g) {
- int fctrl = 1;
- for (int i = 1; i <= g; i++) {
- fctrl = fctrl * i;
- return fctrl;
- }
- }
Add Comment
Please, Sign In to add comment