Lets look at this if statement you wrote:
if( a>=0 && a <= (1000000000000000000))
1000000000000000000 is too big for an integral literal so you will need a bigger literal type. You should declare a as an int64_t and do the comparion like that:
if( a>=INT64_C(0) && a <= INT64_C(1000000000000000000))
Note that this will only work in a C99 or C++11 compiler when you #include <cstdint> or #include <stdint.h>
Edit: in current draft of the standard you can find this sentence (2.14.2/2):
The type of an integer literal is the first of the corresponding list
in Table 6 in which its value can be represented.
It means that compiler should use the required literal type automatically to make your literal fit. Btw I didn't see that kind of compiler.