Question: create a c + + program. We are going to make 3 math functions today. 1 . Create the pow ( power ) function in
create a c program. We are going to make math functions today.
Create the pow power function in myMath.h
kslott@empress cs emacs myMath.h
function comment
b is base explain what each parameter is
e is exponent
This function will return the answer of be explain what the function does and returns
int powint b int e
Compile myMath.h
kslott@empress cs g myMath.h
If you have errors, fix them.
Test your pow function in the main.
kslott@empress cs emacs testMyMath.cpp
testMyMathcpp
#include
using namespace std;
#include myMathhThis line will be replaced by all the code from myMath.h
int main
Explore different ways to call functions
cout pow endl; You can call the function in a cout.
You will see what the function returns.
int ans pow; Storing what the function returns into a variable ans.
cout ans endl;
int base, power;
cout Enter base: ;
cin base;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
