Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
RevArray
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' import java.io.*; import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int[] arr = {1,2,3,4,5}; int start = 0; int end = arr.length-1; while(start<end){ int temp = arr[start]; arr[start] = arr[end]; arr[end] = temp; start+=1; end-=1; } for(int loop:arr) System.out.print(loop+" "); } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Item battle rolyal
3d
add
Check Input
Wenfeng Ou
Simple imitation for show banners on priorities
Hosteller.java
patterns
Java
practicecode
Please log in to post a comment.