write a program in java to accept an integer array with n number of elements.n must be user input. Reverse each elements of the array. Display the original array ,array after reversing each element in the original order and in the reverse order.
Attachments:
Answers
Answered by
2
Answer:
Algorithm
STEP 1: START
STEP 2: INITIALIZE arr[] = {1, 2, 3, 4, 5}
STEP 3: PRINT "Original Array:"
STEP 4: REPEAT STEP 5 for(i=0; i<arr.length ; i++)
STEP 5: PRINT arr[i]
STEP 6: PRINT "Array in reverse order"
STEP 7: REPEAT STEP 8 for(i= arr.length-1; i>=0; i--)
STEP 8: PRINT a[i]
STEP 9: END
Answered by
7
Answer:
STEP 1: START
STEP 2: INITIALIZE arr[] = {1, 2, 3, 4, 5}
STEP 3: PRINT "Original Array:"
STEP 4: REPEAT STEP 5 for(i=0; i<arr.length ; i++)
STEP 5: PRINT arr[i]
STEP 6: PRINT "Array in reverse order"
STEP 7: REPEAT STEP 8 for(i= arr.length-1; i>=0; i--)
STEP 8: PRINT a[i]
STEP 9: END
Hope it's help you
Similar questions