Question: In this program you will be working with an array of integers. The goal of this program is to compare integers within the array, finding

In this program you will be working with an array of integers. The goal of this program is to compare integers within the array, finding the cases where two adjacent numbers are the same.
The first line of input is an integer 1N1000. Initialize an integer array of size N. The next N lines of input will be integers to be stored into this array.
You will then iterate over the array, starting at index 0, searching for adjacent pairs of numbers that equal each other. For example, the array {1,5,3,3,6} contains one adjacent-equal pair, the two 3s. For each pair of adjacent equal numbers in the array, print out the number, followed by a new line. Make sure to stay within the bounds of the array. See the test cases below for examples.
Submit your code in a file named Program10. java to Gradescope.
Sample Test Cases
You can test your program by copying an entire input sample and pasting it into the console. If the output does not exactly match the example output, there is an error in your code.
\table[[Input,Output],[5,],[1,],[5,],[3,3],[3,],[6,],[10,],[7,],[6,],[4,],[4,4],[2,2],[2,1],[5,],[9,],[1,],[1,],[,]]
In this program you will be working with an array

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!