answersLogoWhite

0

int AverageEvenNumbers( int n )

{

return ( n / 2 ) + 1;

}

n / 2 will always give you an int, aka no decimals

if n is 5 the even numbers are 2 and 4, the average is 3

(5) / 2 is 2

2 + 1 is 3

if n is 10 the even numbers are 2 4 6 8 10, the average is 6

10 / 2 is 5

5 + 1 is 6

enjoy

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

Why is it necessary to perform endospore stain to identify clostridium difficile in health care settings?

why is it necessary to perform an endospore stain to identify clostridium in health care settings


Can you baptize your own child, or is it necessary to have a religious figure perform the ceremony"?

In most religious traditions, it is necessary to have a religious figure, such as a priest or minister, perform the baptism ceremony.


What characteristic distinguish disabled individuals from qualified indidivudals with a disability?

The necessary skill, education, and/or experience required for a position, and the ability to perform the essential tasks of a position


When is it necessary to perform a garage door keypad battery replacement?

It is necessary to perform a garage door keypad battery replacement when the keypad stops working or displays a low battery indicator.


When is it necessary to perform a water pressure regulator replacement?

It is necessary to perform a water pressure regulator replacement when the existing regulator is malfunctioning or not maintaining the desired water pressure in the plumbing system.


Businesses are necessary in order to perform what?

Hire, organize, and supply workers.


Do interest groups perform positive functions for government officials?

Interest groups do not perform positive functions for government officials because they stir thoughts and encourages people to battle against what the government officials want to do.


Does it necessary to perform penicillin skin test before tazocin administration?

yes


What skills are necessary to be an actress?

Sing, dance, and perform in front of a live audience.


What is organells jobs?

what does different organs in our human body do? of course they perform different functions necessary for our survival. thus the same is the functions of organelle. they are like different organs in the cell which perform different functions necessary for our life.


During the Umrah pilgrimage, is it necessary to perform the head shave ritual as part of the religious practice"?

No, it is not necessary to perform the head shave ritual during the Umrah pilgrimage, but it is a recommended practice for those who are able and willing to do so.


Can I baptize my child myself, or is it necessary to have a clergy member perform the baptism"?

In most Christian denominations, it is recommended to have a clergy member perform the baptism.