Arrange three integers from least to greatest
Input/output

You need to output a space between the numbers, otherwise they will look like one long number.  It's also customary to finish the output with a newline.

You should verify that you actually received three inputs successfully.

Lint

using namespace std; is considered a bad habit.

Your code would be more readable if you put some spaces with your operators.  For example, cin&gt;&gt;x&gt;&gt;y&gt;&gt;z; would look better as std::cin &gt;&gt; x &gt;&gt; y &gt;&gt; z;

Only initialize what you need to initialize.  For example, int x, y, z; is enough — in fact it's safer, because the compiler can then warn you if you subsequently use one of those variables without assigning a value.

Strategy

You've basically manually written out all the possible comparisons that a sorting algorithm would do, the long way.  I suggest the following short solution (which doesn't generalize beyond three numbers).

#include &lt;algorithm&gt;
#include &lt;iostream&gt;

int main()
{
    int x, y, z;
    std::cout &lt;&lt; "Enter three integers to be arranged from least to greatest.\n";
    if (!(std::cin &gt;&gt; x &gt;&gt; y &gt;&gt; z))
    {
        std::cerr &lt;&lt; "Error in input.\n";
        return 1;
    }

    int first = std::min({x, y, z});
    int third = std::max({x, y, z});

    // Toss x, y, z into a bag, and take out the min and max.
    // What's left is the middle number.
    int second = x ^ y ^ z ^ first ^ third;

    std::cout &lt;&lt; first &lt;&lt; ' ' &lt;&lt; second &lt;&lt; ' ' &lt;&lt; third &lt;&lt; std::endl;
}


Note that std::min({x, y, z}) uses C++11.  For older compilers, you can use std::min(x, std::min(y, z)).