Difference between a sub and a function?

Answer Posted / satishdubey

A Sub Procedure is a method will not return a value
A sub procedure will be defined with a Sub keyword
Sub ShowName(ByVal myName As String)
Console.WriteLine (My name is: & myName)
End Sub

A function is a method that will return value(s).
A function will be defined with a Function keyword
Function FindSum(ByVal num1 As Integer, ByVal num2 As
Integer)
As Integer
Dim sum As Integer = num1 + num2
Return sum
End Function

Is This Answer Correct ?    7 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Described strong typing

658


What is the class that allows an element to be accessed using unique key?

627


What is a static class?

667


What are the objects in asp.net?

635


What is stack used for in vb. Net?

611






What do you understand by vb.net?

688


What are the features present in vb 2005?

652


What is the main purpose of garbage collector?

596


What are the advantages of migrating to vb.net?

642


What is the difference between a "jagged array" and multidimensional array" ?can anyone show me it practically ?

630


What is misl code?

649


What are all the differences between dispose and finalize()?

650


How do you use two datareaders at the same time in a vb.net windows application ?

646


Name some of the features present in vb 2005?

649


Explain about the keyword must inherit?

655