public class PJJJeden { public static void main (String[] args) { double tablica[] = new double[10]; for (int i = 0; i < tablica.length; ++i) { tablica[i] = Math.random() * 10; System.out.println((int)(tablica[i])); if ((int)tablica[i] % 2 == 0){ System.out.println("number is even"); } else { System.out.println("number is odd"); } } } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter