verify your syntax
static void Main(string[] args)
{
Console.Write("You have cross the limit of shares.Do you want to continue?(Y/N)");
string input = Console.ReadLine();
switch (input)
{
case "y": Calculateshare(share: 5, totalBalance: 10);
break;
case "n":
break;
}
}
static void Calculateshare(int share, int totalBalance)
{
}
or
int share = 5;
int totalBalance = 10;
Console.Write("You have cross the limit of shares.Do you want to continue?(Y/N)");
string input = Console.ReadLine();
switch (input)
{
case "y": Calculateshare(share, totalBalance);
break;
case "n":
break;
}