CJCoding With Joseph
15free / daySign inCreate account

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 print No instead. Print Yes or No with no newline.

Expected Output:

Yes

= newline. No newline after the last line.

Hints4 available
Topics:
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.