{}
62
%OFF

Stop copy pasting code you don't actually understand

Build the coding confidence you need to become a developer companies will fight for

Stop copy pasting code you don't actually understand

Become a PRO
Become a PRO
62
%OFF

Stop copy pasting code you don't actually understand

Build the coding confidence you need to become a developer companies will fight for

Stop copy pasting code you don't actually understand

Become a PRO
Become a PRO
run-icon
Main.java
class ReverseArray { public static void main(String[] args) { int[] arr={12,13,5,67,8,9,5,4}; for(int ele: arr){ System.out.print(ele+" "); } int n=arr.length; for(int i=0; i<n/2; i++){ int temp=arr[i]; arr[i]=arr[n-1-i]; arr[n-1-i]=temp; } System.out.println("\nafter reverse="); for(int ele: arr){ System.out.print(ele+" "); } } }
Output