Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.04 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class Calculator {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner input = new Scanner(System.in);
  7.  
  8.         System.out.println("Podaj pierwsza liczbe:");
  9.         int firstNumber = input.nextInt();
  10.        
  11.         System.out.println("Podaj druga liczbe:");
  12.         int secondNumber = input.nextInt();
  13.        
  14.         int result = firstNumber * secondNumber;
  15.         System.out.println("Wynik to: " + result);
  16.  
  17.         if (result % 2 == 0 && result < 50) {
  18.             System.out.println("Liczba jest parzysta i mniejsza od 50");
  19.         } else if (result % 2 == 0 && result > 50) {
  20.             System.out.println("Liczba jest parzysta i wieksza od 50");
  21.         } else if (result % 2 != 0 && result < 50) {
  22.             System.out.println("Liczba jest nieparzysta i mniejsza od 50");
  23.         } else if (result == 50) {
  24.             System.out.println("Liczba jest parzysta i rowna 50");
  25.         } else {
  26.             System.out.println("Liczba jest nieparzysta i wieksza od 50");
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement