Hello, I need help with my C++ code. Specifically this part below. I'll need to enter 3 numbers, for example, 49.96, 49.87, 49.80 and I need to find the biggest difference between two of those numbers. The answer is 0.09 as the biggest difference is between 49.96 and 49.87 (49.96-49.87). But how do I find this number using coding? Sorry if there's not enough info, if you need more information, let me know, I'll add more.
#include <iostream>
#include <cmath>
#include <algorithm>
int main()
{
double a, b, c ;
std::cout << "enter three numbers: " ;
std::cin >> a >> b >> c ;
// the absolute difference between a and b is std::abs(a-b) etc.
// http://en.cppreference.com/w/cpp/algorithm/max
std::cout << "\nthe biggest difference betwen two of these numbers is: "
<< std::max( { std::abs(a-b), std::abs(b-c), std::abs(c-a) } ) << '\n' ;
}