
int pin1 = 4;
int pin2 = 3; 
int led1 = 2;
int led2 = 5;
int button = 8;

void setup() {
  pinMode(led1, OUTPUT);      
  pinMode(led2, OUTPUT);      
  pinMode(pin1, INPUT);
  pinMode(pin2, INPUT);  
  pinMode(button, INPUT);   
}

void loop(){
  if (digitalRead(pin2) != HIGH) {     
    digitalWrite(led1, HIGH);  
  } 
  if (digitalRead(pin1) == HIGH) {     
    digitalWrite(led2, HIGH);  
  } 
  if (digitalRead(button) == HIGH) {
    digitalWrite(led1, LOW);      
    digitalWrite(led2, LOW);  
  } 
}
