You have to sort the array. Because you need to print out the initial position after sorting you have to store that too. The solution is to use a structure:
typedef struct
{
int position;
float value;
} val_struct;
int main()
{
val_struct array[100];
for ( c = 0 ; c < size ; c++ )
{
array[c].position = c;
scanf("%f", &array[c].value);
}
}
Now sort the array and print all items as required. Because it seems this is some kind of homework, it will not post a final solution. You can search online for sorting algorithms or use
qsort - C++ Reference[
^].