This is my assignment, please look at my program and give me any tips? (I'm not quite sure I did it right).
Write a prototype and function for calculating powers of numbers.
This version should have an integer return type and take two integer inputs, for the base and the exponent. It should do the following:
• handle negative bases
• return an error on negative exponents (we’re not doing those yet)
• handle zero exponents
Call your function from a nested loop in main(), which calls the function using every combination of negative, zero and positive numbers for both base and exponent. This will test your function without the user having to input all the data.
Any code which calls the library pow() function will lose half of the assignment points.