I want to make connections between those functions.
public delegate double Math_calculation(double num);
static double z = 6;
static void Main(string[] args)
{
Math_calculation math ;
Math_calculation math1 = cube, math2 = root, math3 = half;
math = math1;
math += math2;
math += math3;
Console.WriteLine($"solution={math(z)}");
}
public static double root(double x) => z=Math.Sqrt(x);
public static double cube(double x) => z=Math.Pow(x, 3);
public static double half(double x) => z= x / 2;
Exactly output:3
Expected output:7.34...(sqrt(216)/2)