void main(void)
{
float x, y;
cin >> x;
y = x * 2.4 - 12;
}
This may produce the compiler warning (or something similar):warning : '=' : conversion from 'const double' to 'float', possible loss of dataTo prevent the warning, use one of these methods:
y = x * float(2.4) - 12;Append type information to literal numbers:
y = x * 2.4f - 12;Next page