Maximum length biotonic subarray problem

https://ide.codingblocks.com/s/51617 what wrong in my code kindly debug

Hey Neeraj, check your code for this case
input:
1
4
10 20 30 40

your code’s output:
8

but the expected output is:
4