Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int num_list[] = {23, 456, 234, 3465, 760976, 234, 1, 346, 2};
- int max_value = num_list[0];
- //Visit all elements
- for (int subscript = 0; subscript < 9; subscript++)
- {
- if (num_list[subscript] > max_value)
- {
- max_value = num_list[subscript];
- }
- }
- cout << "Maximum Number: " << max_value << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment