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 Initialize an integer array of size The next lines of input will be integers to be stored into this array.
You will then iterate over the array, starting at index searching for adjacent pairs of numbers that equal each other. For example, the array contains one adjacentequal pair, the two 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 Program 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.
tableInputOutput
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
