We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
publicclassSolution{publicstaticvoidmain(String[]args){Scannersc=newScanner(System.in);ints=sc.nextInt();// Read the size of the arrayint[]array=newint[s];for(inta=0;a<s;a++)// Reading input values into the array{array[a]=sc.nextInt();}intpd=s-1;for(intl=pd;l>=0;l--){// Print the array in reverse orderSystem.out.print(array[l]+" ");}}}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 7: Arrays
You are viewing a single comment's thread. Return to all comments →