- Back to Home »
- C#.NET »
- C#.NET Method with arguments
Posted by :
Sudhir Chekuri
Thursday, 31 December 2015
It is one type of method and consists of arguments/parameters.
Example
public long add(int a,int b)
{
Console.WriteLine(a+b);
}
Explanation
In the above example the add() can take two values of int type as inputs and doesn't return any type because long data type is a return type but in body section there is no return type.
Example
public long add(int a,int b)
{
Console.WriteLine(a+b);
}
Explanation
In the above example the add() can take two values of int type as inputs and doesn't return any type because long data type is a return type but in body section there is no return type.