Recursive Functions

Recursive Functions

calculateFare() function makes at least one call to itself recursively.

Recursive functions are useful for specific tasks.

There is a danger of infinite function call and to prevent infinite calls, termination conditions must be implanted in the code of the function, which will end the recursive call hierarchy with a non-recursive function execution.