About Me

My photo
Life is good...Life is wonderful...Life is love...Oh yeah yeah yeah... It all part of that game...It all good That's the way...oh yeah yeah yeah... Thodi si meethi hai, Zara si 'MIRCHI' hai... Sau gram zindagi yeh, Sambhaal ke kharchi hai... Asli hai, jhooti hai, Khaalis hai, farzi hai...oh yeah yeah yeah... ~ Dream, Achieve and Win ~

Monday, June 4, 2012

Pass By Value



class PassByValue
    {

        void Input()
        {
            int a;
            int b;
            a = Convert.ToInt32(Console.ReadLine());
            b = Convert.ToInt32(Console.ReadLine());
            System.Console.WriteLine("Inside Input Before Increment\n a=" + a + " \n b =" + b);
            Increment(a,b);
            System.Console.WriteLine("Inside Input After Increment \n a=" + a + " \n b =" + b);
        }
        void Increment(int a, int b)
        {
            a = a * 100;
            b = b * 500;
            System.Console.WriteLine("Inside Increment \n a=" + a + " \n b =" + b);

        }
        public static void Main()
        {
            PassByValue o = new PassByValue();
            o.Input();
            Console.ReadLine();
        }
    }

No comments:

Post a Comment