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?

Continue Learning about Engineering

What is mean of Dead Short in Electrical Term?

The positive and negative voltage lines are tied together - OR - the positive line is shunted to ground with voltage appliedImproved AnswerA dead short is a connection with zero/near-zero resistance. It may be applied deliberately in order to perform tests, or, more usually, as the result of a catastrophic failure in some part/component."The positive and negative voltage lines are tied together - OR" - both lines of an a.c. supply are connected together."the positive line is shunted to ground with voltage applied" - OR - the negative line is shunted to ground, etc etc.


Thesis statement on topic(what are the positive and negative aspects of using robots)?

The use of robots presents both significant advantages and notable drawbacks. On the positive side, robots enhance efficiency and precision in various industries, reduce labor costs, and perform dangerous tasks, thereby improving workplace safety. Conversely, the negative aspects include potential job displacement for human workers, ethical concerns surrounding autonomy and decision-making, and the risk of over-reliance on technology. Balancing these positive and negative effects is crucial for maximizing the benefits of robotic integration into society.


What is lockout tag out?

The OSHA standard for The Control of Hazardous Energy, Title 29 Code of Federal Regulations Part 1910.147, addresses the practices and procedures necessary to disable machinery or equipment, thereby preventing the release of hazardous energy while employees perform servicing and maintenance activities.


What are tasks robots perform?

stuff....


What task does exploratory robot perform?

it does many tasks that can be performed that people cant perform, they arent robots that hop and roll, they dont have to.

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.