class MainClass { public static int Main(string[] args) { // Test if input arguments were supplied: if (args.Length == 0) { Console.WriteLine("Please enter a numeric argument."); Console.WriteLine("Usage: Factorial <num>"); return 1; } // Convert the input arguments to numbers: long num = long.Parse(args[0]); Console.WriteLine("The Factorial of {0} is {1}.", num, Factorial.Fac(num)); return 0; } }
{
public static int Main(string[] args)
{
// Test if input arguments were supplied:
if (args.Length == 0)
{
Console.WriteLine("Please enter a numeric argument.");
Console.WriteLine("Usage: Factorial <num>");
return 1;
} // Convert the input arguments to numbers:
long num = long.Parse(args[0]);
Console.WriteLine("The Factorial of {0} is {1}.",
num, Factorial.Fac(num));
return 0;
}
}