/* overflow.cpp - An example of integer overflow.
	Since int in our machine is represented using 4 bytes,
	it can represent only up to 2 billion plus (4 billion
	plus if we use unsigned int). Thus we will have
	overflow errors if we go beyond those limits.
 */

#include <iostream>

int main()
{
	int a = 0;
	for (int k = 0; k < 10; ++k) {
		a = a + 1000000000;
		cout << '\t' << k << '\t' << a << endl;
	}
	return 0;
}
/* On my system the output of the program is
        0       1000000000
        1       2000000000
        2       -1294967296
        3       -294967296
        4       705032704
        5       1705032704
        6       -1589934592
        7       -589934592
        8       410065408
        9       1410065408
 */
