The Tech Pursuit
The Dev Shelf
Pages
Home
Interview Questions
About Me
April 1, 2015
How to get 2nd highest value from array in C# without using loop
static
void
Main(
string
[] args)
{
int
[] Arr = { 100, 500, 130, 145, 165};
Array
.Sort(Arr);
Array
.Reverse(Arr);
Console
.Write(Arr[1].ToString());
Console
.ReadLine();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment