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