Subroutine and Functions

In what way a subroutine is different from a function?

Questions by savleen123

Showing Answers 1 - 1 of 1 Answers

Through functions we can return values. But through sub we can't return values.

Example:
function add(a,b)
sum=a+b
add=sum
end function

s=add(6,8)
msgbox s

sub add2(x,y)
sum=x+y
msgbox sum
end sub

call add2(6,8)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions