long b = 99;
float c = 99.0F;
//b = c; //Error : Cannot implicitly convert type 'float' to 'long'.
c = b; // Running Successfully. Why?
Why is there no problem regarding size of data type and implicitly converting?
The size of float
and long
is different as we know and which is given below...
Console.WriteLine("Long : " + sizeof(long)); // Output --> Long : 8
Console.WriteLine("Float : " + sizeof(float));// Output --> Float: 4