Increasing Decreasing Sequence(3 test cases not passed)

Rachit u r not considering some cases like
if a sequence can be strictly increasing /decreasing

Also in line number 15-21 there is a problem take a test case
5 6 7 8 9
ur i =1
then while loop will not executes even once as a[i] i not less than a[i-1]
then u decrement i by 1 that is i became 0
then in line 21 u r comparing a[i] with a[i-1] then i-1 is negative
so also change this
HOpe this help:)
for any problem reply

3 test cases not passed

ya i know did u get any hint from the above one?

See, in line no. 16 , the while loop will be terminated if num[i]<num[i-1] or if num[i]>num[i+1]. So i have handled both the cases. If sequence is strictly increasing i go till the end of the sequence.

*the while loop will be terminated if num[i] > num[i-1] or if num[i]<num[i+1] .

see this https://ide.codingblocks.com/s/78032
for refernces check this
https://ide.codingblocks.com/s/78033