27 lines
557 B
Java
27 lines
557 B
Java
|
package VL04.Aufgabe01;
|
||
|
|
||
|
/**
|
||
|
* Vorlesung 4 / Aufgabe 1
|
||
|
*
|
||
|
* @author Sebastian Brosch
|
||
|
*/
|
||
|
public class Aufgabe01 {
|
||
|
public static void main(String[] args) {
|
||
|
final int MAXIMUM = 25;
|
||
|
|
||
|
System.out.printf("\nGerade Zahlen zwischen 1 und %d:\n", MAXIMUM);
|
||
|
|
||
|
for (int i = 1; i <= MAXIMUM; i++) {
|
||
|
if (i % 2 == 0)
|
||
|
System.out.printf("%d\n", i);
|
||
|
}
|
||
|
|
||
|
System.out.printf("\nUngerade Zahlen zwischen 1 und %d:\n", MAXIMUM);
|
||
|
|
||
|
for (int j = 1; j <= MAXIMUM; j++) {
|
||
|
if (j % 2 == 1)
|
||
|
System.out.printf("%d\n", j);
|
||
|
}
|
||
|
}
|
||
|
}
|