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

User Parmanand
by
7.5k points

1 Answer

5 votes
In C:

float average(int x, int y)
{
return (float)((x+y)/2);
}
User Peder Klingenberg
by
8.7k points

No related questions found