Advertisement
Guest User

Untitled

a guest
Apr 11th, 2013
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. /**10.04.2013*/
  2. package Tests;
  3.  
  4. import java.util.*;
  5.  
  6. public class If
  7. {
  8.     public static void main(String argv[])
  9.     {
  10.         int zahl1,zahl2,ergebnis;
  11.         String entscheidung;
  12.         Scanner input = new Scanner(System.in);
  13.         System.out.println("Geben Sie die erste Zahl ein: ");
  14.         zahl1 = input.nextInt();
  15.         System.out.println("Geben Sie die zweite Zahl ein: ");
  16.         zahl2 = input.nextInt();
  17.         ergebnis = zahl1 + zahl2;
  18.         System.out.println(zahl1+"+"+zahl2+"="+ergebnis);
  19.         System.out.println("Wollen Sie noch eine Addition durchführen? Dann geben sie \"Ja\" ein. Ansonsten geben Sie bitte \"Nein\" ein. ");
  20.         //Hier sollte so etwas wie ein "Go To"-Befehl sein.
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement