Read a list by position
Read the value in the position you need. The example picks the second number.
Simple example
Start4 7 9
Result7
using System;
int[] values = new int[] { 4, 7, 9 };
Console.WriteLine(values[1]);
7
Advertisements
Everyday examples
The last three readings were 18, 21 and 19 degrees. Show the middle reading.
Start18 21 19
Result21
using System;
int[] readings = new int[] { 18, 21, 19 };
Console.WriteLine(readings[1]);
21
Run the example
dotnet new console --output Lesson
cp Program.cs Lesson/Program.cs
dotnet run --project Lesson