Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package arraypractice3;
- public class ArrayPractice3 {
- public static void main(String[] args) {
- int[] valA = { 13, -22, 82, 17};
- System.out.println("Original array:");
- for (int i = 0; i < valA.length; i++)
- {
- System.out.print(valA[i] + ",");
- }
- System.out.println(); // new line
- System.out.println("Reversed array:");
- for (int temp = valA.length - 1; temp >= 0; temp--)
- {
- System.out.print(valA[temp] + ",");
- }
- System.out.println(); // new line
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement