Advertisement
CR7CR7

problem

Oct 12th, 2022
644
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Sign {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         //your code here
  7.         float num1 =Float.parseFloat(scanner.nextLine());
  8.         float num2 =Float.parseFloat(scanner.nextLine());
  9.         float num3 =Float.parseFloat(scanner.nextLine());
  10.         multi(num1,num2,num3);
  11.        
  12.        
  13.     }
  14.   private static void multi (float num1,float num2, float num3){
  15.      float product =num1*num2*num3;
  16.         if (product < 0){
  17.             System.out.println("negative");
  18.         } else if (product >0){
  19.             System.out.println("positive");
  20.  
  21.         } else if(product ==0){
  22.             System.out.println("zero");
  23.         }
  24.        
  25.   }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement