Write the definition of a function half, which receives an integer parameter and returns an integer that is half the value of the parameter. (Use integer division!) So if the parameter's value is 7, the function returns the value 3. If the parameter's value happens to be 44, the functions returns the value 22.
.
.
Click on the title for the solution
.
.
int half(int x)
{
int y=x/2;
return y;
}
.
Click on the title for the solution
.
.
This is the answer:
:
int half(int x)
{
int y=x/2;
return y;
}
Comments
Post a Comment