I need to define a variable with 2 decimals to make a simple division.
Ej

float x;
x=1/2


When I execute X has the following value: 0.0000000
I need X has 0.5

What is my error?

Thanks.
PD: I just start to program C++ using Visual Studio 2010 c++