Guest User

Untitled

a guest
May 20th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. public static int largestAbsVal(int one, int two, int three)
  2. {
  3.     one = Math.abs(one);
  4.     two = Math.abs(two);
  5.     three = Math.abs(three);
  6.    
  7.     if(one>two)
  8.     {
  9.         if(one>three)
  10.         {
  11.             return one;
  12.         }
  13.         return three;
  14.     }
  15.     if(two>one)
  16.     {
  17.         if(two>three)
  18.         {
  19.             return two;
  20.         }
  21.         return three;
  22.     }
  23.     if(three>one)
  24.     {
  25.         if(three>two)
  26.         {
  27.             return three;
  28.         }
  29.         return two;
  30.     }
  31.     return one;
  32. }
Add Comment
Please, Sign In to add comment