Advertisement
PadmaJS

Exercise 5.5

Sep 28th, 2022
3,017
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 0.50 KB | None | 0 0
  1. public class Exercise5_5 {
  2.   public static void main(String[] args) {
  3.     Exercise5_5.displayLargestNumber(69.55, 32.32, 22);
  4.   }
  5.  
  6.   public static void displayLargestNumber(double num1, double num2, double num3) {
  7.     if (num1 > num2 && num1 > num3) {
  8.       System.out.println(num1 + " is the largest number");
  9.     } else if (num2 > num3 && num2 > num1) {
  10.       System.out.println(num2 + " is the largest number");
  11.     } else {
  12.       System.out.println(num3 + " is the largest number");
  13.     }
  14.   }
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement