Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Exercise5_5 {
- public static void main(String[] args) {
- Exercise5_5.displayLargestNumber(69.55, 32.32, 22);
- }
- public static void displayLargestNumber(double num1, double num2, double num3) {
- if (num1 > num2 && num1 > num3) {
- System.out.println(num1 + " is the largest number");
- } else if (num2 > num3 && num2 > num1) {
- System.out.println(num2 + " is the largest number");
- } else {
- System.out.println(num3 + " is the largest number");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement