[Solved] Code in C that has the user input 10 numbers and outputs them in a certain order


Welcome to C, Don! There are many ways to approach this, but let’s stick with your array utilization….

1) set the input into an array

2) If you could ensure your input would be 10 values.

for (i=0; i < 5; i++)
{
    for j=9; j > 4; j--)
    {
        printf("%d %d\n", array[i], array[j]);
    }
}
  • “i” is set to zero since the first index location in an array is actually array[0] (not array[1])

You can increment the value of “i” while decrementing the value of “j”, so are working towards the center. Makes sense?

4

solved Code in C that has the user input 10 numbers and outputs them in a certain order