I have the following piece of code that I wrote in C. Its fairly simple as it just right bit-shifts x for every loop of for.
x
int main() { int
Additional information about why integer overflows are undefined can be found here:
http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html
Search for the paragraph "Signed integer overflow".