Implement a void function named rotate that takes two parameters, an array of int nums, an int size representing the size of the array. The function should "rotate" the values forward by one position That means the value at the end of the array will wrap around to the beginning. Example: if nums contains
{1,2,3,4,5}
then after calling rotate(nums, 5
)
; nums will contain
{5,1,2,3,4}
. Hint: save the element at index size to a variable temp. Then loop backwards through the array copying element i-1 to element 1 . Finally, assign temp to element 0 . You should only need four of six lines of code for the function body. 3. Write a complete program to read a sequence of numbers from the console, until a
−100
is read. Each number besides the
−100
represents a temperature. The program will then output the minimum temperature, the maximim temperature along with the average of all the temperatures. You may assume that all the temperatures have values bigger than
−100
. You do not need nor should you use an array for this problem! Special case: If the first number entered is -1 then the output should be "No data entered".