10. Real numbers Find the largest value in the sequence of numbers.
using System;
class Program {
static void Main(string[] args) {
int[] a = new int[7] { 1, 2, 3, 5, 54, 34, 8 };
var max = -999999;
for (int i = 1; i < a.Length; i++) {
if (a[i] > max)
max = a[i];
}
Console.WriteLine(max);
}
}
Comments
Leave a comment