← Back to Arrays
Question 384
Check if Array is Sorted Ascending
Check if Array is Sorted Ascending
An array is sorted in non-decreasing order when every element is greater than or equal to the one before it (equal neighbors are allowed). For the array{2, 4, 4, 8}, this holds, so print exactly the output shown in Expected Output. If any element were smaller than its predecessor you would printNoinstead. PrintYesorNowith no newline.
Expected Output:
Yes= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics:
Arrays
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.