Ask Question

Write the definition of a function half which recieves a variable containing an integer as a parameter, and returns another variable containing an integer, whose value is closest to half that of the parameter. (Use integer division!)

+1
Answers (1)
  1. 7 September, 23:22
    0
    int half (int x) {

    int a=x/2;

    return a;

    }

    Explanation:

    function half (x) which has return type integer and accept an integer type parameter 'x' and return the an integer value in variable 'a' which is closest to half that of the parameter 'x'.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write the definition of a function half which recieves a variable containing an integer as a parameter, and returns another variable ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers