Blinking LEDs in reverse order
You increment a every time and then you decrement it if a == 4. So a equals three in the beginning of you while-loop, then you increment it to four and decrement it, because it equals four. Now it is three again when you jump back to the start of loop.

Try something like:

bool directionForward == true;

while(1) {
    led_display(a);
    delay_sec(1);
    if(directionForward) {
        a++;
        if(a==4) directionForward = false;
    } else {
        a--;
        if(a==0) directionForward = true;
    }
}


And one other point: Try to avoid using this delay-function. Use a timer interrupt instead.