Skip to content

Commit 95855a5

Browse files
authored
Update Multiplication (Recursive)
1 parent a4a63cb commit 95855a5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Course 2 - Data Structures in JAVA/Recursion Assignment/Multiplication (Recursive)

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,18 @@ Sample Input 2 :
2424
Sample Output 2 :
2525
0
2626
*/
27+
28+
public class solution {
29+
30+
public static int multiplyTwoIntegers(int m, int n){
31+
// Write your code here
32+
if (m==0 || n==0)
33+
{
34+
return 0;
35+
}
36+
37+
int smallOutput=multiplyTwoIntegers(m,n-1);
38+
return (m+smallOutput);
39+
40+
}
41+
}

0 commit comments

Comments
 (0)