Write a snippet of code that, given an int array values,
declares a boolean variable named same
and assigns it to true if all elements of values are equal to each other,
and assigns it to false otherwise.
Declare the boolean variable same at the beginning of your program and initialize it
to true. Then reassign it to false inside your loop if you ever find an element that
is not equal to the first element of the array.
Stuck? You may find these lessons helpful: