Question
Coded in C** The goal of this exercise is to implement an exponential number calculator, called exp calculator. (1) First, the user is asked for
Coded in C**
The goal of this exercise is to implement an exponential number calculator, called exp calculator.
(1) First, the user is asked for the base and the exponent. We assume that base is a positive float number and exponent is an integer number.
(2) Then the exponential number is calculated using a recursive function in logarithmic time in terms of the absolute value of the exponent inputted. The result is then displayed.
(3)You can assume that the user always enter float number for the base and integer number for the exponent. Your program should check if the input is positive for the base.
when n>0:
a n = a n/2 a n/2 = (a n/2 ) 2 if n is even
a (n1)/2 a (n1)/2 a = (a (n1)/2 ) 2 a if n is odd
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started