Guest User

Untitled

a guest
Nov 13th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. public class ExMy01MethodFactorialQuestion {
  2.  
  3. public static void main(String[] args) {
  4. int a = 5;
  5. int f = getFctrl(a);
  6. System.out.println(f);
  7. }
  8.  
  9. public static int getFctrl(int g) {
  10. int fctrl = 1;
  11. for (int i = 1; i <= g; i++) {
  12. fctrl = fctrl * i;
  13. return fctrl;
  14. }
  15. }
Add Comment
Please, Sign In to add comment