Advertisement
dmilusheva

MultiplicationSign

Apr 9th, 2020
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. package com.company.homeworkConditionalStatements;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Problem04_MultiplicationSign {
  6.     public static void main(String[] args) {
  7.         Scanner scan = new Scanner(System.in);
  8.         double a = scan.nextDouble();
  9.         double b = scan.nextDouble();
  10.         double c = scan.nextDouble();
  11.  
  12.         double sum = a * b * c;
  13.  
  14.         if (sum > 0) {
  15.             System.out.println("+");
  16.         } else if (sum < 0) {
  17.             System.out.println("-");
  18.         } else {
  19.             System.out.println("0");
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement