Multiple choice technology programming languages

Complete the code. Sub Demo() X = 4 Y = 5 Z = addNum(X,Y) Msgbox (Z) End Sub Function addNum(X,Y) Ans = X + Y <> End Function

  1. Return (Ans)

  2. Return Ans

  3. addNum = Ans

  4. addNum = Return Ans

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Visual Basic functions return values by assigning to the function name itself, not through a 'Return' keyword. 'Return Ans' or 'Return (Ans)' would cause syntax errors because VB doesn't use Return statements. 'addNum = Return Ans' is invalid syntax; only 'addNum = Ans' correctly assigns the computed sum back to the calling code.