Answer to Question #273676 in C# for Holik

Question #273676

10. Real numbers Find the largest value in the sequence of numbers.

1
Expert's answer
2021-12-02T00:38:06-0500
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);
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS