Wednesday, 11 July 2012

Taking Value In Command Line

Take value in Command Line parameter (input value on Excution Time)




using System;
class sum
{
public void add(int a, int b, string s)
{
int c=a+b;
Console.WriteLine("Result :"+c );
Console.WriteLine("Result : "+s);
}
public static void Main(string [] arg)
{
sum s = new sum();
s.add(Convert.ToInt32(arg[0]),  Convert.ToInt32(arg[1]), arg[2]);
       }

}



No comments:

Post a Comment