Ask Question
5 June, 01:54

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. 5 June, 02:36
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers