Advertisement
desant74268

CycleHW

Oct 22nd, 2021
884
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1. package ru.itsjava;
  2.  
  3. public class CycleHW {
  4.     public static void main(String[] args) {
  5.  
  6.         int count = 0;
  7.         while (count < 10) {
  8.             System.out.println((count + 1) + ") " + "I Love Java!");
  9.             count++;
  10.         }
  11.  
  12.         int[] numb = new int[]{0, 2, 5, 6, -9, 3, 7, 8, 2, 6};
  13.         System.out.println(numb[3] + "," + numb[5]);
  14.         System.out.println("Lenght = " + numb.length);
  15.  
  16.         for (count = 0; count < 3; count++) {
  17.             System.out.println("I Love programing in Java!");
  18.         }
  19.  
  20.         System.out.print("Array: {");
  21.         for (count = 0; count < numb.length-1; count++) {
  22.             System.out.print(numb[count] + ", ");
  23.         }
  24.         System.out.print(numb[numb.length-1]+"}");
  25.     }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement