Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class Calculator {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.println("Podaj pierwsza liczbe:");
- int firstNumber = input.nextInt();
- System.out.println("Podaj druga liczbe:");
- int secondNumber = input.nextInt();
- int result = firstNumber * secondNumber;
- System.out.println("Wynik to: " + result);
- if (result % 2 == 0 && result < 50) {
- System.out.println("Liczba jest parzysta i mniejsza od 50");
- } else if (result % 2 == 0 && result > 50) {
- System.out.println("Liczba jest parzysta i wieksza od 50");
- } else if (result % 2 != 0 && result < 50) {
- System.out.println("Liczba jest nieparzysta i mniejsza od 50");
- } else if (result == 50) {
- System.out.println("Liczba jest parzysta i rowna 50");
- } else {
- System.out.println("Liczba jest nieparzysta i wieksza od 50");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement