---
title: "What is the main difference between sub-procedure and function?"  
description: "What is the main difference between sub-procedure and function?"  
author: "Sumit Kesarwani"  
published: 2014-09-02  
updated: 2020-09-21  
canonical: https://www.mindstick.com/interview/2112/what-is-the-main-difference-between-sub-procedure-and-function  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# 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.

## Answers

### Answer by Sumit Kesarwani

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.


---

Original Source: https://www.mindstick.com/interview/2112/what-is-the-main-difference-between-sub-procedure-and-function

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
