Facebook
From Magda2137, 4 Days ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 52
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4. int findMaxValue (vector <int> numbers);
  5. int main() {
  6.     int a = 4, b = 2, c = 5;
  7.  
  8.     cout << "max value is "<< findMaxValue({a, b, c}) << endl;
  9.  
  10.     return 0;
  11. }
  12. int findMaxValue (vector <int> numbers){
  13.     int max = numbers[0];
  14.     for (int number : numbers){
  15.         if (max < number)
  16.             max = number;
  17.  
  18.     }
  19.     return max;
  20. }

Replies to MaxValue rss

Title Name Language When
Re: MaxValue Diminutive Flamingo cpp 4 Days ago.