Home > DeveloperSection > Interviews > What is the main difference between sub-procedure and function?

Posted on    September-02-2014 11:11 PM

 C# C# 
 1 Answer(s)
  1046  View(s)
Rate this:

Sumit Kesarwani

Total Post:782

Posted on    September-02-2014 12:00 AM

The sub-procedure is a block of multiple visual basic statements within Sub and End Sub statements. It is used to perform certain tasks, such as changing properties of objects, receiving or processing data, and displaying an output. You can define a sub-procedure anywhere in a program, such as in modules, structures, and classes.

We can also provide arguments in a sub-procedure; however, it does not return a new value.

The function is also a set of statements within the Function and End Function statements. It is similar to sub-procedure and performs the same task. The main difference between a function and a sub-procedure is that sub-procedures do not return a value while functions do.

Don't want to miss updates? Please click the below button!

Follow MindStick