How to make two conditions in an if statement

So what i am wondering is how do i make it so two different requirements have to be met before the code on the inside of the if statement is run. I am sorry i am probably re posting this question and not giving much information but well what can i say. This is the code i have so far

int first_red_LED = 0;
int second_red_LED = 0;
int green_LED = 0;
int button = 0;
void setup(){
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(2, INPUT);
}

void loop(){
  first_red_LED = random(2);
  second_red_LED = random(this is the number 8 it changed to an emji if i put eight here);
  button = digitalRead(2);
  if (first_red_LED == 1

What i am looking to do is that i want it so that if the variable first_red_LED == 1 and second_red_LED == 2 or 4 then the output being that digitalWrite(3, HIGH). I have simplified what i want to do with the rest of the program in that sentence before. I didn't put the multiple different requirements thing with second_red_LED because i didn't know what it was called. Thank you for reading this and i hope to hear an answer to my question soon. Sincerely, Pi_Co

3_141592_Co: What i am looking to do is that i want it so that if the variable first_red_LED == 1 and second_red_LED == 2 or 4 then the output being that digitalWrite(3, HIGH). I have simplified what i want to do with the rest of the program in that sentence before. I didn't put the multiple different requirements thing with second_red_LED because i didn't know what it was called. Thank you for reading this and i hope to hear an answer to my question soon. Sincerely, Pi_Co

   if ( first_red_LED  == 1 && (second_red_LED  == 2 || second_red_LED  == 4) {
      // do stuff here
   }

The operators are && and ||, They are logical operators, and mean AND and OR, respectively. The parentheses are there to explicitly define the order of precedence. The above statement reads, in Emglish, as:

IF first_red_LED equals 1 AND second_red_LED equals either 2 OR 4, then // do stuff.

Edit: Fixed English translationm of IF statement.

Wow thank you so much that answers my question completely lol i knew there had to be a way.

3_141592_Co: Wow thank you so much that answers my question completely lol i knew there had to be a way.

You're welcome, but please re-read my English translation of the IF statement. I messed it up at first, then just now fixed it.

 if ( first_red_LED  == 1 && (second_red_LED  == 2 || second_red_LED  == 4) {
      // do stuff here
   }

There is a right bracket missing at the end of the if. It should be like this.

 if ( first_red_LED  == 1 && (second_red_LED  == 2 || second_red_LED  == 4) )
   {
      // do stuff here
   }

NOTE - I have changed the style too (braces on separate lines) but that is a matter of personal choice.

bob
i am working on flow meter and control
i have done all program but problem is that when i pressed 1 keypad the flow should be 1 litter i am using follownig conditon for keypad
digitalWrite(c1, HIGH);
digitalWrite(c2, HIGH);
digitalWrite(c3, HIGH);
digitalWrite(r1, LOW);
digitalWrite(r2, HIGH);
digitalWrite(r3, HIGH);

if
(digitalRead(c1) == 0)
{ if
(totalMilliLitresA >= 1000)

{
digitalWrite(53, HIGH);
}

but it is not working an you help me
because led of pin num 53 is not glow when value reach 1000 ml

What does that question have to do with the rest of this two year old thread? Start your own topic for a new question. And when you do, post the whole code not just a snippet. Nobody can tell from just this snippet why your code does not work.

And when you do what Delta_G suggests, do not post the code inline.

You really should have read the How to use this forum - please read post at the top of the index page and How to use this forum before posting. ie Your code and any error messages should always be placed between code tags. Posting it inline as you have done makes it much harder to read or copy and paste for diagnosis.