try this
class Program
{
static void Main(string[] args)
{
Console.WriteLine(myFunction(14));
}
public static int myFunction(int x)
{
return x + 2;
}
}
solved Can’t convert from void to bool compile error