Use integers instead of floating point values. Since you're going with 1 billion in that sample, a 32-bit integer will do fine. If you go beyond 2.15 billion, you'll need an unsigned integer or, if you allow negative numbers, a 64-bit integer.
Edit: also, it's not "void main()" it's "int...