int , if,else if question

int main()
{
int x = 1;
int y = x++;

if (y >= 1)
{
digitalWrite(2, LOW);
delay(1000);
}
else if (y >= 2)
{
digitalWrite(4, LOW);
delay(1000);
}
else if (y >= 3)
{
digitalWrite(6, LOW);
delay(1000);
}
else if (y >= 4)
{
digitalWrite(7, LOW);
delay(1000);
}
else if (y >= 5)
{
digitalWrite(8, LOW);
delay(1000);
}
else
{
digitalWrite(9, LOW);
delay(1000);
}
}

The light does not turn on. help me

Main() is hidden from use. Normally setup() and loop() are what you want if using arduino.

Also if y=5 all those if statements will be true. Is that what you want?
Look into using a switch statement.

ysu4638:
int main()
{
int x = 1;
int y = x++;

if (y >= 1)
{
digitalWrite(2, LOW);
delay(1000);
}
else if (y >= 2)
{
digitalWrite(4, LOW);
delay(1000);
}
else if (y >= 3)
{
digitalWrite(6, LOW);
delay(1000);
}
else if (y >= 4)
{
digitalWrite(7, LOW);
delay(1000);
}
else if (y >= 5)
{
digitalWrite(8, LOW);
delay(1000);
}
else
{
digitalWrite(9, LOW);
delay(1000);
}
}

The light does not turn on. help me

“reverse” your value checking -
check for highest value first.