Question: C++ Write a function named isAscendingList that reads in from the user a list of numbers until the user enters 0. It will return true
C++
Write a function named "isAscendingList" that reads in from the user a list of numbers until the user enters 0. It will return true if the list of number is in ascending or descending order and false otherwise. In addition, it also returns the how many numbers that the user has entered.
For example, if the user enters 10, 30, 40, 0, it will return true and 3 for three numbers. If the user enters 50, 10, 40, 30, 0, it will return false and 4 for four numbers. If the user enters 0 immediately, it will return true and 0.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
