Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void PrintMinMax(int[] arr) {
- int min = a[0], max = a[0];
- for (int i = 1; i < arr.Length; i++) {
- if (a[i] < min)
- min = a[i];
- if (a[i] > max)
- max = a[i];
- }
- Console.WriteLine($"Minimum value: {min}, Maximum value: {max}");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement