Menu
Question Index
...

What will be the output of the following program?

public class Recursion {
    public static void main(String[] args) {
        int a = 35;
        int b = 67;
        int st = loop(a, b);
        System.out.println(st);
    }
    public static int loop(int b, int a) {
        if (b % 13 == 0) {
            return b + a;
        }
        return loop(b++, a / 2);
    }
}


43
106
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Recursive In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App