SHARE
TWEET

Untitled

a guest Feb 27th, 2020 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Arrays;
  2.  
  3. public class Test
  4. {
  5.     public static void main(String[] args) {
  6.      int[] arr = new int[5];
  7.         arr[0] = 1;
  8.         arr[1] = 2;
  9.         arr[2] = 3;
  10.         arr[3] = 4;
  11.         arr[4] = 5;
  12.         int b = 3;
  13.         int c = 4;
  14.         while (c>0) {
  15.         c = arr[b];
  16.         arr[c] = arr[b];
  17.         b--;
  18.         c--;
  19.         }
  20.         arr[0] = 0;
  21.         System.out.println(Arrays.toString(arr));
  22.     }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top