-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZadanie1.java
More file actions
31 lines (29 loc) · 938 Bytes
/
Zadanie1.java
File metadata and controls
31 lines (29 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.company;
public class Zadanie1 {
public static void main(String[] args) {
int a=10;
int b=8;
String text = "0";
if (a<0 || b<0) {
text = "Есть отрицательное число";
System.out.println(text);
}
if (b!=0) {
float result1 = (float) a/b;
text = "Результат деления: " + result1;
System.out.println(text);
}
if (b>a) {
text = "Второе число больше первого";
System.out.println(text);
}
if (b<a) {
text = "Первое число больше второго";
System.out.println(text);
}
if (a%2==0) {
text = "число "+a+" - четное";
System.out.println(text);
}
}
}