Problem in Increasing Decreasing Sequence


Please check the code.
do I have to use arrays?if yes, then this is the code done with help of arrays:-

but the code made with arrays is not running properly.

hi @vivek21,
First of all your code should have a case where if a=b then the code returns false. Secondly if first two number are in increasing sequence than your decreasing sequence has 0 elements and the whole sequence must be increasing . ex- 1 2 3 4 5 … in this 1 and 2 are in increasing hence there cannot be any decreasing sequence in the whole sequence … Check my comments in this code to see your error :- https://ide.codingblocks.com/s/134709