September 4, 2014
C# Custom Methods with Multiple Parameters Example
C# custom methods with multiple parameters are very helpful. You can pass different kind of data type variables to get the desired output. A custom method in C# can have parameters in the form of integer, string, float, custom class, custom structure, custom interface etc. The C# custom methods with multiple parameters example is given below, where we are passing a string as well as integer data type to call our custom method.
using System; namespace comments { class Program { static void Main(string[] args) { string total = "The total is "; int count = 10; PrintMessage(total, count); } public static void PrintMessage(string total, int count) { Console.WriteLine(total + count); } } }
Output:
The total is 10
Press any key to continue . . .