Created foreach loop
This commit is contained in:
parent
bf10077762
commit
248b18cae8
@ -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]}!");
|
||||
|
Loading…
x
Reference in New Issue
Block a user