WHAT IS THE MAIN DIFFERENCE BETWEEN SUB-PROCEDURE AND FUNCTION?

Sumit Kesarwani

Total Post:782

Points:3910
Posted by  Sumit Kesarwani
C# 
C#
 1222  View(s)
Ratings:
Rate this:
  1. Sumit Kesarwani

    Post:782

    Points:3910
    What is the main difference between sub-procedure and function?

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!