Tuesday, March 18, 2014

For Loop Ex 2_(Wk_6) Feb 10-14

Exercise 2: Multiply all value between 10 and 20.

 static void Main(string[] args)
        {
            long product = 1;
            for (int n = 10; n <= 20; n++ )
            {
                product *= n;
                Console.WriteLine("Counter: {0} Product: {1}", n, product);
            }
                Console.ReadLine();
        }

No comments:

Post a Comment