Welcome to Westonci.ca, the place where your questions are answered by a community of knowledgeable contributors. Join our Q&A platform and connect with professionals ready to provide precise answers to your questions in various areas. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform.

I need an If else statement that sorts three numbers from a file from least to greatest

Sagot :

void sort3(int& a, int& b, int& c)
{
if (a > b)
{
std::swap(a, b);
}
if (b > c)
{
std::swap(b, c);
}
if (a > b)
{
std::swap(a, b);
}
}