Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. public class Solution
  2. {
  3.     public static int min(int a, int b)
  4.     {
  5. int m2;
  6.       if (a < b)
  7.            m2 = a;
  8.       else
  9.            m2 = b;
  10.  
  11.       return m2;
  12.     }
  13.  
  14.     public static void main(String[] args) throws Exception
  15.     {
  16.         System.out.println( min(12,33) );
  17.         System.out.println( min(-20,0) );
  18.         System.out.println( min(-10,-20) );
  19.     }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement