how to blink 2 LEDs alternately??

i am trying to blink 2 leds alternatively but only one is blinking the other one is nor....what should be the problem??

the code is given below

void setup(){
pinMode(3, OUTPUT);
pinMode(2,OUTPUT);
}
void loop() {
digitalWrite(3,HIGH);
delay(1000);
digitalWrite(3, LOW);
delay(1000);
digitalWrite(2,HIGH);
delay(1000);
digitalWrite(2, LOW);
delay(1000);
}

when i run this code only one led blinks. please help with this

thank you

LEDs wired the correct way around?
Current limiting resistors in place?
Connected to the correct pins?

Which LED blinks? Concentrate on checking the wiring of the other one.

Steve

If you REALLY ONLY want to have one LED on when the other one is off you just need 1 Arduino I/O pin connected (through a resistor) to a common connection between the LEDs and the other leg of one LED goes to GND and for the second LED it goes to 5v. When the I/O pin is HIGH the LED connected to GND will light and when if is LOW the LED connected to 5v will light.

...R