Won't break out of for loop
An int can't hold 1000000.  It is a signed 16-bit variable, which means it can only hold between -32768 and +32767.

To store larger numbers you need to use long, or unsigned long which are signed and unsigned 32-bit variables.