Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void main()
- {
- int a[5] = { 3, 2, 1, 5, 4 };
- int sum = 0;
- for (int i = 0; i<5; i++)
- if (a[i]>sum)
- sum = a[i];
- cout << sum;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement