Created
October 23, 2015 10:15
-
-
Save edinak1/589d99edbdd7bdbf272f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package metod; | |
| public class Min { | |
| public static void main(String[] args) { | |
| int a=7,b=-2, c =7; | |
| System.out.println("Minimum = " + min(a,b,c)); | |
| a=-23; b=-2; c =9; | |
| System.out.println("Minimum = " + min(a,b,c)); | |
| a=7; b=2; c =0; | |
| System.out.println("Minimum = " + min(a,b,c)); | |
| } | |
| static int min(int a,int b,int c) | |
| { | |
| if(a<=b && a<=c ) | |
| return a; | |
| else | |
| if(b<=a && b<=c) | |
| return b; | |
| return c; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment