Ask Question
20 August, 06:00

g Write a line of code to invoke a function named RandNum, which accepts no parameters, and storing the return value in a variable called num (which has already been defined). Separate each item with 1 space (except around the parentheses), and end the line with a semi-colon.

+3
Answers (1)
  1. 20 August, 09:37
    0
    public int RandNum ();

    * Assuming it returns an integer

    Explanation:

    I believe you mean to write the function header of randNum.

    To write the header of the function, we need to specify its return type, name, parenthesis and parameters inside the parenthesis - if exist.

    If it returns an integer it should have int, if it returns a double it should have double in the header. In the answer, I assumed it returns an integer.

    The name is already given, RandNum

    Since, the function does not take any parameter, inside of the parenthesis will be empty.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “g Write a line of code to invoke a function named RandNum, which accepts no parameters, and storing the return value in a variable called ...” 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