Increasing decreasing sequence

sir i am not getting how to approach for this problem
which loop to use
it is given not use array

It says that a sequence can be of following cases :

  1. Only increasing sequence
  2. Only decreasing sequence
  3. Increasing and then decreasing sequence
  4. Decreasing and then increasing sequence

You have to write the code such that when your input sequence is any of 1,2,4…the output should be true. Else for case 3, the output should be false.
Also take care of the case when two consecutive numbers in the sequence appear to be the same. In this case again the output should false

You can use any of the loops according to your convenience.