Choosing how to earn college credit? CLEP vs AP guide
| preferred AP College board partner for AP classes
medium Solved by 5 students

Recursive Multiplication Method

Mark
< Prev
Next >

What is printed as a result of executing the following program?

public class Multiply {
    public static int multiply(int a, int b) {
        if(b == 0)
            return 0;
        return a + multiply(a, b - 1);
    }
    public static void main(String[] args) {
        System.out.println(multiply(6, 4));
    }
}
A

10

B

18

C

24

D

20

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1richa.tuli22 0m 03s 197
#2busemagngr22 0m 38s 162
#3yekeon051511 - 100
#4lsj0803092211 2h 12m -7,853
Items per page:
10
1 – 4 of 4
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Instagram: @_apfive_|Privacy Policy|