expected primary-expression before '>' token, distance sensor program

The program used to work fine but after I added the range here:
if (distance <=100 & >60)
it was also highlighted as the source of problem… I fail to see the mistake after a lot of checking so can anyone help me out?

void setup() {
  Serial.begin (9600);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  pinMode(led, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(led5, OUTPUT);
  pinMode(buzzer, OUTPUT);
   
}

void loop() {
  long duration, distance;
  digitalWrite(trigPin, LOW); 
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = (duration/2) / 29.1;
 

  if (distance <=100 & >60) {
    digitalWrite(led, HIGH);
    delay(200);                  // waits for a second
    digitalWrite(led, LOW);    // sets the LED off
    delay(200);                  // waits for a second
    sound = 300;
}
  else {
    digitalWrite(led,LOW);
  
  }
  if (distance <= 60 & >20 ) {
      digitalWrite(led3, HIGH);
      delay(100);                  // waits for a second
      digitalWrite(led3, LOW);    // sets the LED off
      delay(100);                  // waits for a second
      sound = 375;
} 
  else {
    digitalWrite(led3, LOW);
    digitalWrite(led,LOW);
    
  }
  
  if (distance <= 20) {
    digitalWrite(led5, HIGH);
    delay(50);                  // waits for a second
    digitalWrite(led5, LOW);    // sets the LED off
    delay(50);                  // waits for a second   
    digitalWrite(led,LOW);
    sound = 450;
}
  else {
    digitalWrite(led5,LOW);
 
  }
 
  if (distance > 100 || distance <= 0){
    Serial.println("Out of range");
    noTone(buzzer);
  }
  else {
    Serial.print(distance);
    Serial.println(" cm");
    tone(buzzer, sound);
   
  }
  delay(500);
}

Thank you in advance,

  if ( fruit == apple || fruit == pear )
    Serial.println( "healthy");

  if ( weight > 120 && length < 180 )
    Serial.println( "not healthy");

What I’m saying is: the ‘&’ is a logical bitwise ‘AND’ operator, the condition needs a double ‘&&’.

Please edit your post, select the code, and put it between [code][/code] tags.

You can do that by hitting the “Code” button above the posting area (It looks like a scroll with < > inside it).

How to use this forum

   if (distance <=100 & >60)

Should be:

   if (distance <= 100 && distance > 60)

Peter_n:

  if ( fruit == apple || fruit == pear )

Serial.println( “healthy”);

if ( weight > 120 && length < 180 )
    Serial.println( “not healthy”);




What I'm saying is: the '&' is a logical bitwise 'AND' operator, the condition needs a double '&&'.

Alright, Thank you problem solved!