I have worked on Java and new to .Net technology
Is it possible to declare a function in C# which accepts variable input parameters
Is there any C# syntax simila
Have a look at params (C# Reference)
The params keyword lets you specify a method parameter that takes a variable number of arguments.
You can send a comma-separated list of arguments of the type specified in the parameter declaration, or an array of arguments of the specified type. You also can send no arguments.
No additional parameters are permitted after the params keyword in a method declaration, and only one params keyword is permitted in a method declaration.
As shown in the example the method is declared as
public static void UseParams(params int[] list)
{
for (int i = 0; i < list.Length; i++)
{
Console.Write(list[i] + " ");
}
Console.WriteLine();
}
and used as
UseParams(1, 2, 3, 4);