Pass float to a function
using System;
class MainClass
{
public static void Main() {
float f = 6.0F;
float s = Avg(5.0F, f);
Console.WriteLine(s);
}
public static float Avg(float Input1, float Input2)
{
return (Input1 + Input2) / 2.0F;
}
}
Output 5.5
|
HTML code for linking to this page:
Related in same category :
-
-
-
|