work two LEDs simultaneously

how can I write a code in Arduino using for loops and if statements to make two LEDs work simultaneously, the first one should stay on for 10 sec then 9 ,8 and so on, and stay off for the same period and the second one should stay on for 1 sec then 2,3 ...,10,also stay off for the same period

I wouldn't bother with for loops, unless you've been told you have to.
Take a look at the blink without delay example, and remember that one LED stays ON for x seconds, and the other remains ON for 10 - x seconds.

Have a look at the demo Several Things at a Time. It manages 3 LEDs.

...R

With a for loop? OK, if you insist. This has a for loop. This handles one LED. You can write a similar one for the other led.

at global scope

int t = 10;
boolean ledState = LOW;
int firstLedPin = 13;

Then in loop:

for  (static unsignedd long p=millis(); millis()-p>=(t * 1000ul);p = millis()){
    ledState = !ledState;
    digitalWrite(firstLedPin, ledState);
    if(ledState == LOW){
      t = t -1;
      if(t == 0){
        t = 10;
      }
    }
  }

Here is the same question on SO https://stackoverflow.com/questions/48894638/work-two-leds-simultaneously-with-different-rates

If you're just going to ask the whole internet to do your homework for you, please at least show enough consideration to link the questions together so I don't waste my time talking here when someone on SO has already done your homework for you.

Or better yet, do your own homework. You might learn something.

I can't use millis(), it's only have to be done using if statements and for loops.
I'm new to Arduino, I am learning actually, and its not a homework, I tried several times to solve it but the two LEDs keep working after each other not simultaneously.

lamees_ghassan:
I can't use millis()..... and its not a homework,

Well if it's not homework set by someone else, why give yourself artificial constraints?

lamees_ghassan:
I can't use millis() .... I am learning actually

Arguably THE most important thing you can learn, is the use of millis()-based, delay()-less time management.

And I'm confused by your timing description, although I'm sure it makes sense to you.

How about you present us a timeline: draw two horizontal lines, one for each led, one under the other, with t=0 at the left and seconds marked off across to the right.

Then on each line, mark off in thicker pen the "on" periods for each led.

lamees_ghassan:
I can't use millis(), it's only have to be done using if statements and for loops.

Why?

...R

Robin2:
Why?

...R

He must be lying about it not being homework. The only way such a crazy restraint is there is because some teacher put it there to try to force students to learn some other method. Otherwise that constraint is just stupid.

lamees_ghassan:
I can't use millis(), it's only have to be done using if statements and for loops.
I'm new to Arduino, I am learning actually, and its not a homework, I tried several times to solve it but the two LEDs keep working after each other not simultaneously.

Your are not making sense. If you want the LED to stay on or off for a period of time you are going to need to know how much time has elapsed and the way to do that is using millis().

The reason that your LEDs will be working after each other is probably that you will have written code to control LED1 which has to complete before the code you have written for LED2 is reached.

Post your code within the </> tags.