Respuesta :

The definition of the function named absoluteValue is give as follows:

int absoluteValue(int number) {

 if (number < 0)

     number = number * (-1);

 else if (number > 0)

     number = number;

 else

     number = 0;

 return number;

}

What is a function?

A function is merely a piece of code that you can reuse rather than writing it out several times. Software Code Writers can use a set of codes called functions to break down or break down an issue into smaller elements, each of which performs a precise objective.

To achieve the above function,

  • Make a function called absoluteValue that takes an integer parameter, number
  • Review to see if the number is smaller than 0. If it is, reproduce the number with -1
  • Check if the number is greater than 0. If it is, assign it to itself then review it to see if the number is 0. If it is, designate it to 0 then Return the number

Learn more about functions:

https://brainly.com/question/20476366

#SPJ1

ACCESS MORE
EDU ACCESS
Universidad de Mexico