Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package MethodsMoreExercise;
- import java.util.Scanner;
- public class O5MultiplicationSign {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int a = Integer.parseInt(scanner.nextLine());
- int b = Integer.parseInt(scanner.nextLine());
- int c = Integer.parseInt(scanner.nextLine());
- printResult(a, b, c);
- }
- public static void printResult(int a, int b, int c) {
- if (a == 0 || b == 0 || c == 0) {
- System.out.println("zero");
- } else if (a < 0 && b > 0 && c < 0 || a < 0 && b < 0 && c > 0 || a > 0 && b < 0 && c < 0 || a > 0 && b > 0 && c > 0) {
- System.out.println("positive");
- } else {
- System.out.println("negative");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment