To find the maximum of three numbers in C++, you can use the `std::max` function from the
In this example,
a
, b
, and c
with the numbers to compare.#include <iostream>
#include <algorithm>
int main() {
int a = 5;
int b = 8;
int c = 3;
int max = std::max(std::max(a, b), c);
std::cout << "Maximum of three numbers is: " << max << std::endl;
return 0;
}
Maximum of three numbers is: 8
In this tutorial, we learned How to find the Maximum of Three Numbers in C++ language with well detailed examples.