You have directed the printf function to print out a decimal floating point number. As such, you have been given some decimal places.
If you want it to direct the number of decimal places, use the appropriate .precision value (try %4.2f, for example, and experiment with them to get a feel for what you can do). Take a look at the printf page and see all the options available to you. http://cplusplus.com/reference/clibrary/cstdio/printf/
A better option would be to use proper C++ objects.
@ OP: I completley agree, but don't use an IDE that is old enough to start kindergarten. Try using it's more up to date spin off: http://wxdsgn.sourceforge.net/
In defence of Moschops not using the std namespace, this is pretty difficult to name a specific reason. But as someone who does the same the first time it burns you and has you tearing your hair out for hours when it's 1:00 AM and no one is on the forms to help you; you'll never use it again.
I don't agree with this statement "Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :) ". LOL :=)
This Dev-C++ 7.3.1 is 100 times better than 4.9.9.2.
Thank you guys!!!
To a degree I'm joking around, but they are distinctly different programmes.
Dev-C++ was mostly written and maintained by Colin Laplace and chums until early 2005. It used the MinGW port of the GNU C++ compiler, which was bundled with Dev-C++. As such, if you download Dev-C++, you're going to have a six year old C+ compiler. It's possible to update the compiler, but it's a bit of a pain, and if you put in that much effort you might as well switch away from Dev-C++ entirely.
wxDev-C++, courtesy of Guru Kathiresan and team, aimed to fill the hole left behind by the cessation of Dev-C++. It is under development, and I understand comes with a recent compiler, which makes a big difference. It has some features to make using wxWidgets easier.