Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package übung1;
- public class lern1 {
- public static void main(String[] args){
- String zahl;
- zahl = "Die Hälfte wurde erechnet";
- long a = 500;
- byte b = 3;
- long schleife = 0;
- long c = a/2;
- System.out.println(schleife);
- while(a > schleife){
- schleife = schleife + b;
- System.out.println(schleife);
- if(schleife==c){
- System.out.println(zahl);
- }
- }
- if(schleife>=a){
- System.out.println("Ihm "+b+"er schritten wurde bis "+a+" berechnet");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement