Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- bool isSorted(const int array[], int size)
- {
- for (int i = 0; i < 80; i++)
- {
- array[i];
- size = array[0];
- if (array[i] > array[i-1])
- {
- return true;
- }
- else
- {
- return false;
- break;
- }
- }
- }
- int main()
- {
- int array[80];
- int size = array[0];
- cout << "Enter List: ";
- bool output = isSorted(array, size);
- if (output == true)
- cout << "The list is sorted";
- if (output == false)
- cout << "The list is not sorted";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement