Answer:
x=5.8
x=7.8
x=7.8
Step-by-step explanation:
I repaired the code somewhat (see below).
Since x is passed as a reference variable to the sub function, inside sub() the original variable is modified, so the changed value affects the variable declared in main().
If you would remove the & in sub, this wouldn't happen, and the variable in main would keep its value 5.8.