Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool isSorted(int number[], int SIZE);
- int main()
- {
- cout << " Enter list: ";
- int SIZE;
- cin >> SIZE;
- const int A = SIZE;
- int number[A];
- for (int i = 0; i < SIZE; i++)
- {
- cin >> number[i];
- }
- if (isSorted)
- cout << " The list is already sorted \n" << endl;
- else
- cout << " The list is not sorted \n" << endl;
- return 0;
- }
- bool isSorted(int number[], int SIZE)
- {
- for (int i = 0; i < SIZE; i++)
- {
- if (number[i] > number[i + 1])
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment