I am doing study and creating a program related to command line arguments.In this program i am going into if statement. Now I have question here why here string[] args length is 0?How can set args value so that I can get the desired result
Here is my code which I am using
static void Main(string[] args)
{
double val1 = 0.0;
double val2 = 0.0;
if (args.Length == 0)
{
Console.WriteLine("No argument has been specified");
Console.ReadLine();
return;
}
val1 = double.Parse(args[0].ToString());
val2 = Math.Sqrt(val1);
Console.WriteLine("Square Root of the val2 is: {0}\n",val2);
Console.ReadLine();
}
Please resolve this problem experts