asphongsai
asphongsai asphongsai
  • 25-11-2020
  • Computers and Technology
contestada

Define a function perimeter(base, height) that returns the perimeter of a rectangle with side lengths base and height

Respuesta :

absor201
absor201 absor201
  • 25-11-2020

Answer:

int perimeter(base,height)

{

int perimeter_of_rectangle;

perimeter_of_rectangle= 2(base+height);

return (perimeter_of_rectangle);

}

Explanation:

Lets name the function perimeter. It has two parameters base and height.

The function will have return type. In this case I am taking int but it can be float as well.

The function would be:

int perimeter(base,height)

{

int perimeter_of_rectangle;

perimeter_of_rectangle= 2(base+height);

return (perimeter_of_rectangle);

}

Answer Link

Otras preguntas

Janes quiz scores: 82 64 73 91 85 what is the mean ?
Identify two powers the US Constitution prohibits the states from having.
_____ is the belief that people should be as free as possible from government restraints. a. Nationalism b. Monoculturalism c. Industrial capitalism  d. Liberal
write 6/10 as a terminating decimal
what decimal is equivalent to 122/11?
Janes quiz scores: 82 64 73 91 85 what is the mean ?
Which of the following elements is not necessary to prevent value conflicts in the work place? A. ToleranceB. ConsiderationC. AvoidanceD. Honest communication
What is an ion? in chemistry
_____ is the belief that people should be as free as possible from government restraints. a. Nationalism b. Monoculturalism c. Industrial capitalism  d. Liberal
list the six external parts of a computer system, identify which is the output device and which is the input device?