Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions

Question

mple 10. Determine d dx S 0 t dt.

Answered: 1 week ago

Question

f. Did they change their names? For what reasons?

Answered: 1 week ago