Advertisement
CR7CR7

MultiplicationSign

Sep 22nd, 2022
868
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. public class MultiplicationSign {
  2.     public static void main(String[] args) {
  3.         Scanner sc = new Scanner(System.in);
  4.         double num1 = Double.parseDouble(sc.nextLine());
  5.         double num2 = Double.parseDouble(sc.nextLine());
  6.         double num3 = Double.parseDouble(sc.nextLine());
  7.  
  8.         double product = num1 * num2 * num3;
  9.  
  10.         if (product > 0) {
  11.             System.out.println("+");
  12.         }else if (product == 0) {
  13.             System.out.println(0);
  14.         }else System.out.println("-");
  15.     }
  16.  
  17.  
  18.     }
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement