From f1d9371e820d2cf42535b65aa112cb3f5d4d5fa1 Mon Sep 17 00:00:00 2001 From: Dushyantha Thilakarathne Date: Wed, 20 Oct 2021 13:55:11 +0530 Subject: [PATCH] ReverseArray.java I have updated this code for saving the reversed array. --- ReverseArray.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/ReverseArray.java b/ReverseArray.java index 7fdfae1..48a03ae 100644 --- a/ReverseArray.java +++ b/ReverseArray.java @@ -11,23 +11,22 @@ * * @author Shanmuga Priya M */ -public class reversearray { - - /** - * @param args the command line arguments - */ - public static void main(String[] args) { +public static void main(String[] args) { int a[]=new int[10]; + int riv_a[]=new int[10]; int n,i; Scanner obj= new Scanner(System.in); - System.out.println("enter sizr of array"); + System.out.println("enter size of array : "); n=obj.nextInt(); - System.out.println("enter elements of array"); + System.out.println("enter elements of array : "); for(i=0;i=0;i--){ - System.out.println(a[i]); + for(i=0;i