You are given an int variable k, an int array zipcodelist that has been declared and initialized , and an boolean variable duplicates. write some code that assigns true to duplicates if there are two adjacent elements in the array that have the same value , and that assigns false to duplicates otherwise. use only k, zipcodelist, and duplicates.

Respuesta :

Thank you for posting your question here at brainly. I hope the answer will help you. Feel free to ask more questions here.
Below is the answer:

duplicates = false;
for(k = 0; k < zipcodeList.length - 1; k++)
{
if(zipcodeList[k] == zipcodeList[k + 1])duplicates = true;

}