Difference between a sub and a function?
Answers were Sorted based on User's Feedback
Answer / m.sivakumar
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 ? | 21 Yes | 2 No |
Answer / 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 |
Write a program that accepts an array of numbers and a number, and return a string “Yes” if the number is found in the array, “No” if the number is not found in the array.
Explain global assembly cache (gac)?
What is the use of internal keyword?
What is an indexed property?
How can we store decimal data in .net?
i have two class that contain's two methods as same name in derived class i have to call these two methods what will happen at run time ?
Write a program that accepts an array of numbers, and two numbers (an element and a position in the array) and inserts the given element into nth position of the array.
how to save items in gridview and the form name is vendor rating?
Which namespace are used for accessing the data?
What is the difference between convert.tostring and i.tostring method?
What is branching logic control in VB.NET?
hi dear ? MY problem is that i m developing software for Library. and i want to connect a third party software with my VB.net program in order to calculate DDC number.I dont know how to do this if any body can help me please?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)