Created foreach loop

jason.zhu 2021-02-16 03:42:26 +00:00
parent 55d59b3fed
commit 0bb17c73ef
1 changed files with 10 additions and 0 deletions

View File

@ -6,6 +6,16 @@ namespace GradeBook
{
static void Main(string[] args)
{
var numbers = new[] {12.7, 10.3, 1.1};
double result = 0;
foreach (var number in numbers)
{
result += number;
}
System.Console.WriteLine(result);
if (args.Length > 0)
{
Console.WriteLine($"Hello, {args[0]}!");