Tuesday, August 29, 2017

1. Write a Program in C# to demonstrate Command line arguments processing.

 namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
 {
  System.Console.WriteLine("\nNumber of command line arguments : " + args.Length);
  System.Console.WriteLine("Command line arguments are : \t");
  for (int i = 0; i < args.Length; i++)
  {
  System.Console.WriteLine(args[i]+"\t");
 }
 System.Console.ReadKey(); //system is built in package
  }      
  }
}
 //writeline -- curson will move on to nextline || write -- execte in  current line
//readline --  || readkey --
// try to do without any argument in string and in Main M must be capital

No comments:

Post a Comment