Answer:
double half (double number) //to pass by reference is not important here
{
double half; //number again should not be declared here
half = number / 2;
return half;
}
int main()
{
cout<<half(50);
}
Output :
25
Step-by-step explanation:
As not mentioned in the question, any data type could have been used like int , float or double. Method half() takes a double variable as parameter which is passed as value as we don't need to make the change at the same address we need value of that argument only. A variable half of double type is declared which will hold the half value. Number is not required to declared again here as it is passed by argument. Then the number is divided by 2 and half is returned.