Tuesday, November 25, 2008

Functions

Functions in C# are a means of providing blocks of code that can be executed at any point in an application.

for a example you could have a function to calculates the addition of to numbers.So you can use this function from any point in your code.Also we can think this function as reusable code.

Here you can see simple console application that use a single function.



Return Values


The simplest way to exchange data with a function is to use a return value. Functions that have return values evaluate to that value.

the simple example for the return typle function we can show as below.

No comments: