Named Parameters C# with Example



Named Parameters C# with Example

 	using System;

	namespace CSharpFundamentals
	{
		class NamedParameters
		{
			private static void Main(string[] args)
			{
				Console.WriteLine("Signature Addition_int_float for 10+20.0f: {0}", Addition(y:10, x:20.3f));
				Console.WriteLine("Signature Addition_float_int for 10.5f+20: {0}", Addition(10.5f, 20));
			}

			static float Addition(float x, int y)
			{
				return x+y;
			}			
		}
	}
 

0 Comment's

Comment Form

Submit Comment