asked 166k views
5 votes
Write a method called average that accepts two integer parameters and returns their average as a floating point value.

1 Answer

5 votes
In C:

float average(int x, int y)
{
return (float)((x+y)/2);
}

No related questions found