Change a variable to text for serial monitor (Arduino Uno)

I’m using an HC-SR04 Ultrasonic Sensor that displays distance, there’s two if statements, if it’s below 0 it comes out as 0 (that part works as intended), if it’s over 4 meters (distance variable is a centimeter) it is supposed to say "Out of range", and that’s the part I’m having an issue with. Here’s the full code

const int TrigPin = 2; 
const int EchoPin = 3; 
float distance;

void setup() {
  Serial.begin(9600); 

  pinMode(TrigPin,OUTPUT);
  pinMode(EchoPin,INPUT);
}

void loop () {

  digitalWrite(TrigPin,LOW);
  delayMicroseconds(2);
  digitalWrite(TrigPin,HIGH);
  delayMicroseconds(10);
  digitalWrite(TrigPin,LOW);

  distance = pulseIn(EchoPin,HIGH)/58.0; // divided by 58 to change into cm

  if(distance < 0) {
    distance = 0;
  } 
  if(distance > 400) {
    distance = "Out of range";
  }

  Serial.println(distance );
}

This returns an error that says "cannot convert ‘const char [13]’ to ‘float’ in assignment" (line 26), is there any way to convert the distance variable without using a new variable? (There’s already another if statement for the distance variable). I am a pretty early beginner in this so the solution could be extremely simple and I just don’t know it.

Source: Windows Questions C++

LEAVE A COMMENT