Given two number x and y find product using recursion.
Input : x = 5, y = 2 Output : 10 Input : x = 100, y = 5 Output : 500
1) If x is less than y, swap the two variables value
2) Recursively find y times the sum of x
3) If any of them become zero, return 0
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Product of 2 numbers using recursion | Set 2
- Sum of natural numbers using recursion
- Print even and odd numbers in a given range using recursion
- Decimal to Binary using recursion and without using power operator
- Solving f(n)= (1) + (2*3) + (4*5*6) ... n using Recursion
- Sum of array elements using recursion
- Mean of array using recursion
- Remove duplicates from a sorted linked list using recursion
- Reverse a Doubly linked list using recursion
- Decimal to binary number using recursion
- Sum of digit of a number using recursion
- Binary to Gray code using recursion
- Program for length of a string using recursion
- Print alternate nodes of a linked list using recursion
- Reversing a queue using recursion
- Leaf nodes from Preorder of a Binary Search Tree (Using Recursion)
- Generating subarrays using recursion
- Program to check if an array is palindrome or not using Recursion
- Sum of array Elements without using loops and recursion
- Find the value of ln(N!) using Recursion
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : jit_t