This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Created by Чуєнко Віталій on 19.10.2016. | |
| */ | |
| public class Ex1 { | |
| public static void main(String[] args) { | |
| int a = 4; | |
| if (a % 2 == 0) { | |
| System.out.println("even"); | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.company; | |
| public class Home_2_T_1 { | |
| public static void main(String[] args) { | |
| int a = 8; | |
| if (a%2==0) { | |
| System.out.println("even"); | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.company; | |
| public class Main { | |
| public static void main(String[] args) { | |
| int a = 4; | |
| if(a % 2 == 0) { | |
| System.out.println("even"); | |
| } else { | |
| System.out.println("odd"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| public class Ex1 { | |
| public static void main(String[] args) { | |
| Scanner in = new Scanner(System.in); | |
| System.out.print("Введіть додатне число = "); | |
| int a = in.nextInt(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| сложн ( ̄ー ̄) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Ex1 { | |
| public static void main(String args[]) { | |
| int a = 4; | |
| System.out.print(a); | |
| if (a % 2 == 0) { | |
| System.out.println(" is Even number"); | |
| } else { | |
| System.out.println(" is Odd number"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Ex2 { | |
| public static void main(String[] args) { | |
| final int COUNT = 7; | |
| String s = "I will adopt best practices"; | |
| for (int i = 0; i < COUNT; i++) { | |
| System.out.println(s); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Ex5 { | |
| public static void main(String[] args) { | |
| int n = 15; | |
| int m = 3; | |
| for (int i = 1; i <= n; i++) { | |
| if (i % m == 0) { | |
| System.out.print(i + " "); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Ex6 { | |
| public static void main(String... args){ | |
| for(int i = 1; i < 10; i++){ | |
| for(int k = 1; k < 10; k++){ | |
| System.out.print(k * i + "\t"); | |
| } | |
| System.out.println(); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Ex1 { | |
| public static void main(String[] args) { | |
| int[] arr = new int[3]; | |
| arr[0] = 1; | |
| arr[1] = 423; | |
| arr[2] = -32; | |
| for(int i = 0; i < arr.length; i++) { | |
| System.out.println(arr[i]); | |
| } |