Created
February 4, 2018 06:34
-
-
Save TranNgocMinh/d3049beabeb9628b46d29def8b870ef4 to your computer and use it in GitHub Desktop.
This file contains 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
import java.util.Scanner; | |
public class Program { | |
public static void main(String[] args) { | |
float a,b; | |
Scanner scanner = new Scanner( System.in ); | |
System.out.print( "Nhap a = " ); | |
a = Float.parseFloat(scanner.nextLine() ); | |
System.out.print( "Nhap b = " ); | |
b = Float.parseFloat(scanner.nextLine() ); | |
System.out.println("So lon nhat la:" + Max(a,b)); | |
} | |
public static float Max(float a, float b){ | |
float max = 0; | |
if(a>b) | |
max = a; | |
else | |
max = b; | |
return max; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment