CJCoding With Joseph

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:

Yes

If any element were smaller than its predecessor you would print No instead. Print Yes or No with no newline.

Expected Output:

Yes
Topics:
Arrays
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.