So my instructor for my c++ class wants us to make multiple functions that do various operations on an initial value given by the user. He told us to essentially create user-defined functions, even for operations that have predefined functions such as pow, abs, etc.
Unfortunately, I have never run into a problem where I have to multiply a variable by itself without using the pow function, so I am not sure how exactly to go about it.
Edit: the error message comes about when I attempt to multiple initial by initial and assign it to squared.
double squared = double initial * double initial;
You're declaring doubles which are uninitialised, so when you do arithmetic on them, you will most likely end up with junk values, usually large negative/positive values.
I'm not sure what you intended the parameter squared to do. Maybe it's the exponent? Maybe you meant to assign initial2 to it? (you'll need to pass it by reference if you intend to do that)