Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Raise {
- public static double recRaiseHalf(double x, int k) {
- if(k == 0) {
- return 1;
- }
- double y = recRaiseHalf(x, (k/2));
- if(k % 2 == 0) {
- System.out.println("K is even " + k);
- return y * y;
- }
- else {
- System.out.println("K is not even " + k);
- return y * y;
- }
- }
- public static void main(String[] args) {
- System.out.println(recRaiseHalf(12,3));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement