Ultrasonic sensor add cm

Hi i have a Project going on and i want to put the sensor on my 300 cm high car,
So now i want the 300 to add to the outcome in cm so 300 plus the height i measure how do i add this in the code. EX: 300 plus 150cm i measure so its auto writes 450cm on the sensor outcome.

#define trigPin 10
#define echoPin 13

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

void loop() {
float duration, distance;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);

digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);
distance = (duration / 2) * 0.0344;

if (distance >= 400 || distance <= 2){
Serial.print("Distance = ");
Serial.println(“Out of range”);
}
else {
Serial.print(“Distance = “);
Serial.print(distance);
Serial.println(” cm”);
delay(500);
}
delay(500);
}

Are you asking how to add 150 to a variable?

Serial.print(distance+300);

Ok thank you guys
How do i hide the code from Arduino program.
I just want seriell monitor to show up can it be done

Petervn:
How do i hide the code from Arduino program.

?

Put it behind the sofa?

Haha so There is no other Way

If you don’t want to do it in the Serial() call just use distance = (duration / 2) * 0.0344 + 300; or distance += 300 (and of course amend your range check as needed).

The main question that remains: why do you even need to ask about something as basic as this?

Im new to this.

We guessed that.