LCD setCursor not working for me....

Arduino Mega with 16X2 LCD connected.
I was thinking this snippet would put the digits in their columns - 1 in col 1, 2 in col 2, etc.
But it doesn’t - it just puts 6 in col 6.
What have I got wrong?

#include <LiquidCrystal.h>
LiquidCrystal lcd(22,24,26,28,30,32);

void setup() {
// put your setup code here, to run once:

int i;

for (i=0;i<6;i++);
lcd.setCursor (i,0);
lcd.print (i);
delay (3000);

void loop() {
// put your main code here, to run repeatedly:

No lcd.begin() ?

Thanks UKHeliBob, I missed that out.
I've put in the begin and it still doesn't work...

How can that code ever write "6" to the LCD? In the for loop, i goes from 0 to 5. Is that really the code you're using?

That's the code - I copy/pasted it.
No idea why it puts a '6' in column six either!
Should be really simple.
I just have this feeling that I'm missing something really obvious...

I'd put a semicolon at the end of the IF statement...
Oh dear.

I’d put a semicolon at the end of the IF statement…

There is no if statement in your code, but there is a for loop…

The semicolon would have been easier to see if you had used code tags like this

for (i=0;i<6;i++);

Ahaha! I missed that!

This is also a good reason to limit the scope of i to the for loop:

for (int i = 0; i < 6; i++)

Then i would be undeclared outside the loop if you accidentally put a semicolon at the end of the line.