Sinux1

T7E4.cpp

Apr 9th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main()
  6. {
  7.     int num_list[] = {23, 456, 234, 3465, 760976, 234, 1, 346, 2};
  8.     int max_value = num_list[0];
  9.  
  10.     //Visit all elements
  11.     for (int subscript = 0; subscript < 9; subscript++)
  12.     {
  13.  
  14.         if (num_list[subscript] > max_value)
  15.         {
  16.             max_value = num_list[subscript];
  17.         }
  18.  
  19.  
  20.  
  21.  
  22.     }
  23.  
  24.     cout << "Maximum Number: " << max_value << endl;
  25.  
  26.     return 0;
  27. }
Add Comment
Please, Sign In to add comment