Computer Science, asked by 21730676, 9 months ago

Correct all the compile and logical errors in this method so it returns true if there are two equal consecutive values in the array, otherwise the method returns false. For example, if the array contains {5, 6, 0, 0, 3} the method returns true. If the array contains {5, 6, 4, 0, 3} the method returns false. public static boolean CheckConsecutiveDuplicate(int[] A) { for(int i=0; i

Answers

Answered by Anonymous
1

Explanation:

The compile and logical errors in this method so it returns true if there are two equal consecutive values in the array, otherwise the method returns false. For example, if the array contains {5, 6, 0, 0, 3} the method returns true. If the array contains {5, 6, 4, 0, 3} the method returns false. public static boolean CheckConsecutive Duplicate.

Similar questions