โ Back to Arrays
Question 244
Is the Array Sorted Ascending
Is the Array Sorted Ascending
An int array is given. Print 'Sorted' if every element is less than or equal to the next one (ascending order), otherwise print 'Not sorted'.
For the array {1, 3, 5, 7} the program prints:
SortedExpected Output:
Sorted
Topics:
Arrays
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.