Question: Please write it in C++ Important requirements for all questions: No global variable is allowed to be declared and used. Constants are ok. Functions cannot
3. Write a function named "isIncrementingBy1" that accepts an array of integers and its size. It will go through the array and return true if every element in the array has the value of the previous element +1 such as an array of {1,2,3,4} or {10,11,12,13,14}. It returns true if the array has only one element. It returns false otherwise. In addition, it also returns another flag indicating whether the array contains only non-zero positive numbers or not. You can assume that the array has at least one element. For example, the following arrays and their expected return values
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
