HarrJ

B8 Day 9 loops

Sep 20th, 2022
1,430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. package mattroseb8wk2;
  2.  
  3. public class Day09D {
  4.     public static void main(String[] args) {
  5.         int limit = 0;
  6.  
  7.         while (limit <= 20) {
  8.             System.out.println(limit);
  9.             limit++;
  10.         }
  11.         System.out.println("-----***-----");
  12.        
  13.         limit = 10;
  14.         do {  
  15.             System.out.println(limit);
  16.             limit--;
  17.         } while (limit >= 0);
  18.        
  19.         for (int i = 0; i < 10; i++) {
  20.             System.out.println("counting: " + i);
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment