Assume that a, b, c are numbers. Return 'increasing' if they are in increasing order, 'decreasing' if they are in decreasing order, 'both' if they are both increasing and decreasing, and 'neither' otherwise. Here, 'increasing' means that each value is at least as large as its predecessor. Similarly for decreasing.
Assume that a, b, c are numbers.
Return 'increasing' if they are in increasing order,
'decreasing' if they are in decreasing order,
'both' if they are both increasing and decreasing, and
'neither' otherwise.
Here, 'increasing' means that each value is at least as large
as its predecessor. Similarly for decreasing.
The sequence 3, 4, 4 is increasing. whereas
the sequence 4, 4, 4 is both increasing and decreasing.
For example,
lenient(3, 4, 5) returns 'increasing'
lenient(3, 4, 4) returns 'increasing'
lenient(4, 4, 4) returns 'both'
lenient(4, 3, 2) returns 'decreasing'
lenient(4, 3, 3) returns 'decreasing'
lenient(4, 2, 3) returns 'neither'
We have to write a program that can enter a number a,b,c and Return 'increasing' if they are in increasing order,
'decreasing' if they are in decreasing order,
'both' if they are both increasing and decreasing, and
'neither' otherwise.
Step by step
Solved in 4 steps with 3 images