Write a recursive function to convert a given string into the number it represents. That is input will be a numeric string that contains only numbers, you need to convert the string into corresponding integer and return the answer.
Input format: Numeric string (string, Eg. "1234")
Output format: Corresponding integer (int, Eg. 1234)
Sample Input 1: "1231"
Sample Output 1: 1231
Sample Input 1: "12567"
Sample Output 1: 12567
Algorithm:
Example:
Input = "23" First Traversal = 2, Second Traversal = 20 + 3, Result = 23C++ program:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer