SHARE
TWEET

Fxp C# Help

a guest Oct 12th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static void PrintMinMax(int[] arr) {
  2.     int min = a[0], max = a[0];
  3.  
  4.     for (int i = 1; i < arr.Length; i++) {
  5.         if (a[i] < min)
  6.             min = a[i];
  7.         if (a[i] > max)
  8.             max = a[i];
  9.     }
  10.  
  11.     Console.WriteLine($"Minimum value: {min}, Maximum value: {max}");
  12. }
RAW Paste Data
Top