Quick helpn needed!

Write the definition of a function signOf, that receives an integer parameter and returns a -1 if the parameter is negative, returns 0 if the parameter is 0 and returns 1 if the parameter is positive.

So, if the parameter 's value is 7 or 803 or 141 the function returns 1. But if the parameter 's value is -22 or -57, the function returns -1. And if the parameter 's value is 0, the function returns 0.

Thank You so much!
1
2
3
4
int signOf( int &param )
{
    // good luck
}
Last edited on
Topic archived. No new replies allowed.