Mixed Mode Compiler Warnings

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 data
To prevent the warning, use one of these methods:

Explicit type cast:
y = x * float(2.4) - 12;
Append type information to literal numbers:
y = x * 2.4f - 12;
Next page
Previous page
Go to Lesson 4 index.