Google "C++ printf example" and carefully read what the % arguments mean. This should help you work out what went wrong.
The scanf function returns a value so you should make use of that to see that it worked. This isn't related to your current problem, but is a good practice.
If you are going to use any library function, always google it to see how it works.
A program returns an error code to the operating system.
A value of 0 usually means "all OK", and is the default in C99 and C++98 even if your main() is missing a return 0;.
In Windows you can manually check the last error code from the Console with:
echo %errorlevel%
In Linux, from the Shell:
echo $?
If neither my reply nor TheIdeasMan's reply helps, please rephrase your question.
It is an error to call printf with arguments whose types do not match the format specifiers.
Assuming that by "returning" you mean "displaying", I guess your compiler passes floats and ints in different CPU registers (gcc does that, for example) so that when it looks for an int as instructed by %d, it finds whatever was in that register earlier, in this case,zero.