Menu
Coddy logo textTech

Max Value

Lesson 4 of 18 in Coddy's Functions in C++: Building Your Own Functions course.

challenge icon

Challenge

Easy

Write a function to find the maximum value in a list.


The max function takes a list of numbers and returns the maximum value.

 

For example:

  • If the input list is [3, 5, 1, 7], the result will be 7.




     

Try it yourself

#include <iostream>
#include <vector>
using namespace std;

int max() {
    
   
}

All lessons in Functions in C++: Building Your Own Functions