Snippets

Ettar Java - While-Scheife

Created by Ettar

File while.java Added

  • Ignore whitespace
  • Hide word diff
+public static void main(String[] ARGS){
+    Scanner scanner = new Scanner(System.in);
+    int gesucht = 3;
+
+    while(scanner.nextInt()!=gesucht){
+        System.out.println("Falsche Zahl");
+    }
+    System.out.println("Richtig! Die gesuchte Zahl war 3");
+}
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.