Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static int multiplyRec(int x, int y) {
- if (y == 0) return 0;
- return x + multiplyRec(x, y - 1);
- }
- public static void main(String[] args) {
- System.out.println(multiplyRec(5, 3));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment