001 package de.hska.java.aufgaben.kontrollstrukturen;
002
003 /**
004 * Gibt alle Teiler einer ganzen Zahl auf
005 * dem Bildschirm aus.
006 *
007 *
008 * <p>
009 * <a href="http://www.home.hs-karlsruhe.de/~pach0003/informatik_1/aufgaben/kontrollanweisungen.html#teiler">Zurück zum Aufgabentext</a>
010 * </p>
011 *
012 * @author Christian Pape
013 *
014 */
015 public class Teiler {
016
017 public static void main(String[] args) {
018 int zahl = 666;
019
020 for (int teiler = 2; teiler < zahl; teiler++) {
021 if (zahl % teiler == 0) {
022 System.out.println(teiler);
023 }
024 }
025 }
026
027 }