File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * To change this license header, choose License Headers in Project Properties.
3+ * To change this template file, choose Tools | Templates
4+ * and open the template in the editor.
5+ */
6+ package com .mycompany .worksheet1 ;
7+
8+ import java .util .Scanner ;
9+
10+ /**
11+ *
12+ * @author Shanmuga Priya M
13+ */
14+ public class reversearray {
15+
16+ /**
17+ * @param args the command line arguments
18+ */
19+ public static void main (String [] args ) {
20+ int a []=new int [10 ];
21+ int n ,i ;
22+ Scanner obj = new Scanner (System .in );
23+ System .out .println ("enter sizr of array" );
24+ n =obj .nextInt ();
25+ System .out .println ("enter elements of array" );
26+ for (i =0 ;i <n ;i ++){
27+ a [i ]=obj .nextInt ();
28+ }
29+ for (i =n -1 ;i >=0 ;i --){
30+ System .out .println (a [i ]);
31+ }
32+ }
33+
34+ }
You can’t perform that action at this time.
0 commit comments