Advertisement
irapilguy

Untitled

Jan 30th, 2021
707
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void main()
  5. {
  6.     int a[5] = { 3, 2, 1, 5, 4 };
  7.     int sum = 0;
  8.  
  9.     for (int i = 0; i<5; i++)
  10.         if (a[i]>sum)
  11.             sum = a[i];
  12.     cout << sum;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement