Find a error in the following program segments and explain how error can be corr
ID: 3553176 • Letter: F
Question
Find a error in the following program segments and explain how error can be corrects. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
Function addttogether(By Val num1 as integer, num2 as Integer)
Dim result as integer
Result = num1 + num2
End Function.
Find a error and correct it
Sub printer this (By Val a lists as single)
Dim alist as single
Console. WriteLine(alists)
End sub
Explanation / Answer
Dear,
Function addttogether(By Val num1 as integer, num2 as Integer) //Function return type missing
Dim result as integer
Result = num1 + num2
//need to return Result
End Function.
Corrected code:
Function addttogether(By Val num1 as integer, num2 as Integer) As Integer
Dim result as integer
Result = num1 + num2
return Result
End Function.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.