using System;
public class Program
{
public static void Main()
//1. Create a console application that uses a (1) while and (2) a for loop to calculate the product of the first 10 and 20 integer numbers. Start at 1.
// You will write 2 while and 2 for loop statement
// Using while (product of first 10)
long sum = 1;
int number = 1;
while (number <=10)
sum *= number;
number++;
}
Console.WriteLine(sum);
// Using while (product of first 20)
long Tsum = 1;
int Ti = 1;
while (Ti <= 20)
Tsum *= Ti;
Ti++;
Console.WriteLine(Tsum);
// Using for loop (product of first 10)
long result = 1;
int i;
for (i=1; i <=10; i++)
result *= i;
Console.WriteLine(result);
// Using for loop (product of first 20)
long Tresult = 1;
int Tnum;
for (Tnum=1; Tnum <=20; Tnum++)
Tresult *= Tnum;
Console.WriteLine(Tresult);
// 2. Given m=1777 and n =2022, what is the sum of the numbers between m and n (both included in the sum)?
// Add this for loop to your program above
long Gresult = 0;
int Gi;
for (Gi=1777; Gi <= 2022; Gi++)
Gresult += Gi;
Console.WriteLine(Gresult);