Using i2c pins

So even though those pins are made for i2c i can use this code?

Yes you can use that code.

No those pins are not the I2C pins, the I2C pins are the ANALOGUE pins 4 & 5

If you want to use the analogue / I2C pins as digital pins you use pin numbers 18 & 19

They are not made for I2C it is just that I2C is one of the modes they can operate in.