Simple loop problem

Hi,

I am just starting out with Arduino and am working my way through the examples in the Franzis Tutorial Kit but I an unable to get a simple loop working correctly. I have written a simple sketch to test it out and I get same problem as using the example in the book.

I want to output the values in an array using a for loop with the variable increment of 1 until it reaches the limit, however I don’t get what I expect. I have output each variable in the array manually and they are correct so it is a problem with the for loop.

My code is below

int Array[]={1,2,3,9,5};

void setup() 
{
  
Serial.begin(9600);
Serial.println("Test");
Serial.println();
  }
  
  void loop() 
    {
  
     byte y;
    
    Serial.println("Output test");
    Serial.println();
    for (y=0;y<4;y++);
      {
      
      Serial.println(Array[y]);  
      Serial.println();
      
      //Serial.println(Array[0]);
      //Serial.println(Array[1]);
      //Serial.println(Array[2]);
      //Serial.println(Array[3]);
      //Serial.println(Array[4]);
      
      }
    while(1);
    }

The output looks like this:

Test

Output test

5

Any ideas gratefully received.

    for (y=0;y<4;y++);

for statements don’t generally end with a ;.

That fixed it - thanks!