Guest User

Untitled

a guest
Oct 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. if (n==0) {
  2. System.out.println(1);
  3. } else {
  4. if (n%2==0) {
  5. for (i=2;i<n+1;i+=2) {
  6. p=p*i;
  7. }
  8. System.out.println(p);
  9. } else {
  10. for (i=1;i<n+1;i+=2) {
  11. p=p*i;
  12. }
  13. System.out.println(p);
  14. }
  15. }
Add Comment
Please, Sign In to add comment