Perhaps the question is: I guess you realise why? What could you do so that it isn't 0.0, and gives a more "expected" answer - half of x + y? There are several different options.
Edit:
If one wants to know what code does: Write a small program and execute it.
> I think it creates a new variable z and initialises it with 0 but I'm not sure
If the expression (x+y) evaluates to
anything other than NaN, positive infinity or negative infinity: initialise with 0.0
otherwise: initialise with NaN
If it is an exam question, you may also want to add: if either x or y is uninitialised, the initialisation of z engenders undefined behaviour.
it will initialize a new variable into z. Try to learn those rules of c++ as it can lead to errors within your code if you don't. If you are having troubles doing that you can try using some code security program as help. I tend to use checkmarx. Works fine.
Good luck!
Ben.