Page 1 of 1

Why does a float variable stop incrementing at number ‘16777216’ in the following C# code?

Posted: Wed Jul 13, 2022 7:56 pm
by answerhappygod
float a = 0 ; while (true) { a++; if (a > 16777216) break; }
a) Sign and Exponent for ‘16777217’ is same as for ‘16777216’
b) Mantissa is different for ‘16777216’ and ‘16777217’
c) Sign and Exponent for ‘16777217’ is different from ‘16777216’
d) None of the mentioned