how to make an input functionality in c# code example
Example 1: c# function as input
public delegate double MyDelegateType(double x);
public double Consummer(double x, MyDelegateType f){
return f(x);
}
public double MyFunctionMethod(double x){
return x;
}
public void Client(){
double result = Consummer(1.234, x => x * 456.1234);
double secondResult = Consummer(2.345, MyFunctionMethod);
}
Example 2: how to make an input in c#
string myName;
Console.WriteLine("Please, enter your full name here: ");
myName = Console.ReadLine();
Console.WriteLine("Hello, Mr. " + myName + "!");
Console.Key();
Console.WriteLine("Please, enter your full name: ");
string myName = Console.ReadLine();
Console.WriteLine("Hello, Mr. " + myName + "!");
Console.ReadKey();