Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. package übung1;
  2.  
  3. public class lern1 {
  4.  
  5.    
  6.     public static void main(String[] args){
  7.     String zahl;
  8.     zahl = "Die Hälfte wurde erechnet";
  9.     long a = 500;
  10.     byte b = 3;
  11.     long schleife = 0;
  12.     long c = a/2;
  13.     System.out.println(schleife);
  14.     while(a > schleife){
  15.     schleife = schleife + b;
  16.     System.out.println(schleife);
  17.     if(schleife==c){
  18.         System.out.println(zahl);
  19. }  
  20.     }
  21.     if(schleife>=a){
  22.         System.out.println("Ihm "+b+"er schritten wurde bis "+a+" berechnet");
  23.     }  
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement