Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int maximum(int numbers[], int c);
- int* oddSwap();
- int* expand();
- int* concatenate();
- int* subArray();
- const int c = 5;
- int main()
- {
- int numbers[5] = { 1, 5, 9, 6, 7 };
- cout << "testing maximum: " << endl;
- cout << "Expected maximum: 9" << endl;
- cout << "Actual maximum: " << maximum(numbers, 5) << endl;
- cout << endl;
- delete[] numbers;
- system("pause");
- return 0;
- }
- //
- int maximum(int numbers, int c)
- {
- int max;
- max = 0;
- for (int count = 0; count <= 5; count++)
- {
- if (max < numbers[count])
- max = numbers[count];
- }
- return (max);
- }
- //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement