It's a good thing that you didn't specify a language and implied that you were thinking of unbounded integers, because it means I can point you to this prototype analyzer for a toy language available as a web app.
With unbounded integers, rici is right, this is the halting problem. However, most other problems solved by static analyzers are also equivalent to the halting problem. That does not prevent the static analyzers in question from being useful. They work around the undecidability by accepting to have false negatives, false positives, or both.
If you prefer to use a C-like syntax, you can also use Frama-C's value analysis to determine whether a simple C program terminates. This analyzer does not handle recursive functions, and it treats integer types as bounded (which they are). Bounded integer types makes the problem easier in theory (for some definitions of the input language, it becomes decidable) but it is still hard in practice.