PJF16

PowerOfTwo

Dec 8th, 2015
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.18 KB | None | 0 0
  1.     public static boolean powerTwo (int n, int z) {
  2.         if (z > n)
  3.             return false;
  4.         if (z==n)
  5.             return true;
  6.         return powerTwo(n,z*2);
Advertisement
Add Comment
Please, Sign In to add comment