SHARE
TWEET

kacka

Rob95 May 19th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static int maximum( int[] arr )
  2.     {
  3.         if (arr.length == 0)
  4.         {
  5.             return 0;
  6.         }
  7.         int max = arr[0];
  8.         for (int i = 0 ; i<arr.length; i++)
  9.         {
  10.            
  11.             int number = arr[i];
  12.            
  13.             if (max < number)
  14.             {
  15.                 max = number;
  16.             }
  17.         }                  
  18.         return max;
  19.     }
  20.    
  21. }
RAW Paste Data
Challenge yourself this year...
Learn something new in 2017
Top