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

what is the meaning of NADPH2
if x=at^3 and y=bt^2 then find dy/dx
what is the meaning of NADPH2
Why is it 5 :30 p.m in India and 12 :00 noon in London ?
the transfer of goods, crops, and diseases between New and Old World societies after 1492 How was it called?
Name the important city through which the Prime Meridian passes through.
An experiment consists of rolling two fair number cubes. What is the probability that the sum of the two numbers will be 4? Express your answer as a fraction in
the transfer of goods, crops, and diseases between New and Old World societies after 1492 How was it called?
What are the factors on which pressure of liquids depends??
i know that earth is spinning very fast but why don't we fell  it spinning ?