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

If ALTU ASBP then TU = [?] Enter the letters that belong in the green box. Enter
In the past, personal selling has garnered a reputation as being too aggressive. You would like to test whether these perceptions have changed after the impleme
Who led the Protestant Reformation? a. Martin Lawrence b. Martin Luther II c. Martin Luthley d. Martin Luther Please select the best answer from the choices pro
Patrick is at Murphy's Pub when he sees a short man wearing a green suit, top hat, and buckled shoes. Also, the man is carrying a pot of shiny gold. Based on wh
Dilation of 1.5 about the origin
HELPPPPPP ASAPPPPPP!!!!!!!!
What form of government is used in the United States by our legislative and executive branches being separated? A. Parliamentary government B. Presidential go
Which elements belong at the start of an informational text
what is 0.0000128 as a fraction
12 - 8g = -92 show work