Ask Question

Examine the following piece of code and determine the data type of the function's return value.

Function Real sum (integer num1, integer num 2)

Declare Integer result

Set result = num1 + num2

Return result

End Function

A) Real

B) Integer

C) Sum

D) Result

E) None of these

+3
Answers (1)
  1. 14 April, 08:12
    0
    The answer is "Option A".

    Explanation:

    In the code, there are so many errors, So the correct explanation of the code and wrong options are described as follows:

    In the given question a method Realsum is defined that accepts two integer variable that is "num1 and num2" as a parameter. Inside a function, a variable Setresult is defined that add (num1 and num2) variable value and use return keyword for return added value. The function is given a real value because in the function if we pass negative or positive value it will calculate it and return its value.

    wrong options:

    In option b, The function returns a value that is positive or negative that it is not correct. In option C, The function adds value and returns it value in the function there is not a sum that's why it is not correct. In option D, The function returns a value that is stored in a setresult variable that's why it is not correct.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Examine the following piece of code and determine the data type of the function's return value. Function Real sum (integer num1, integer ...” 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