Answer the question
In order to leave comments, you need to log in
Explain what this C# code does?
public int[] values;
public int lowNumber;
lowNumber = values[0];
for (int i = 0; i < values.Length; i++)
{
if (values[i] < lowNumber)
{
lowNumber = values[i];
}
}
Answer the question
In order to leave comments, you need to log in
searches for the smallest
although this code will fall out
var lover = values.Min();
This will be both more compact and faster
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question