0

I am currently starting to learn c#, but i just cant figure out how to get the highest value out of this array

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Arraysagainupsididitagain
{
    class Program
    {
        static void Main(string[] args)
            //auftrag 8
        {

            string[] zahlen = new string[10] ;
            for(int i = 0; i < zahlen.Length; i++)
            {
                Console.WriteLine("Enter a value above 0:");

                zahlen[i] = Console.ReadLine();

            }
            Console.ReadLine();
            for(int uebergang = 0; uebergang < zahlen.Length; uebergang++)
            {
                Console.WriteLine(zahlen[uebergang]);

            }




            Console.ReadLine();
        }
    }
}

I would really apprechiate if someone could help me with this.

1 Answers1

0

Before Console.ReadLine()

 Array.Sort(zahlen);
 int n = zahlen.Length;
 Console.WriteLine("More highest value: {0}", zahlen[n-1]);
CoolLife
  • 1,419
  • 4
  • 17
  • 43