Sorted array using recursion

Take as input N, the size of an integer array. Take one more input, which is a list of N integers separated by a space, and store that in an array. Write a recursive function which prints true if the array is sorted, and false otherwise.

Input Format
N x y z

Constraints
1 < N < 1000
-10^9 < i < 10^9, where i is an element of the array

solution link: https://ide.codingblocks.com/s/277774

one test case is not passing

@1799sanya line 12 use less than equal to(as numbers can be equal)
i hope its clear if yes dont forget to hit like and mark resolved :smiley:

you missed the scenario when we have duplicate values in our array.
Dry run this test case:-
5
1 2 3 5 5

you should add = sign also in you if statement

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.