codes in highest and lowest in sorting array

Recommended Answers

All 2 Replies

If want to find the highest and lowest VALUE in an array, you could implement the Array.sort method that is available in C#. Here is the example of the Array.sort method in action. Now once you figure out how to implement that method, it will organize the VALUES in ascending order. This means that you can find the smallest value at the first index, and the highest value at the last index.

in .net arrays, you have access to the First and Last methods. They also implement the Max and Min methods which work with any array of number values or values that can be transformed to numbers

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.