Question
MyPow() Function ASSIGNMENT: Write a program to re-create the pow() function. Your function should work just like the pow() function - you should pass 2
MyPow() Function ASSIGNMENT:
Write a program to re-create the pow() function. Your function should work just like the pow() function - you should pass 2 numbers to the function: a double for the number to raise to a power, and an integer for the power to raise the number to, and the function will return a double of the number raised to that power.
Your function must not use the pow() function - you are re-creating the pow() function.Test your function against the pow() function to make sure it is working correctly - in other words, invoke both your function and the pow() function, passing them both the same numbers, and display the results for both functions (which should be identical). Your function should also work with negative numbers for the power to raise the number to, just as the pow() function does. Do not format the output numbers to any specific number of decimal places - you want to see the 'raw' numbers generated by the functions.
There is no validation for this program.
Example Run #1: (bold type is what is entered by the user)
Enter a number to raise to a power: 2
Enter the power to raise 2 to: 5 2 raised to the power of 5 is:
My Function pow() function
xx.xxxxxx xx.xxxxxx
Example Run #2:
Enter a number to raise to a power: 10
Enter the power to raise 2 to: -2
10 raised to the power of -2 is:
My Function pow() function
x.xxxxxx x.xxxxxx
The example runs show EXACTLY how your program input and output will look.
Write in C, with printf and scanf statements, with constant (example) MIN_PRIME.
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