How will I solve my problem : expected primary-expression before '>' token // defines pins numbers
const int trigPin = A0;
const int echoPin = A1;
// defines variables
long duration;
int distance;

#include &lt;moving.h&gt;
#include &lt;Servo.h&gt;

Servo servo;

moving car(6, 2, 3, 5, 4, 7, 11, 8, 9, 10, 12, 13); // setting up a new RC car with pins EN1, IN1, IN2, EN2, IN3, IN4, EN3, IN5, IN6, EN4, IN7, IN8

void setup() {
{
  for (int i=2; i&lt;14; i++)
  {
    pinMode(i, OUTPUT);
  }
  servo.attach(10);
  servo.write(90);
}
{
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
}
}

void loop() {
  if (distance) &gt; 10; // this is the problem
  car.set_speed(127);
  car.forward();
  delay(3000);
  if (distance) &lt; 10; // and this
  car.set_speed(0);
  car.forward();
  delay(600);
  car.set_speed(127);
  car.right();
  delay(700);
  car.set_speed(127);
  car.forward();
  delay(700);
}
You need curly brackets around your if block.

if (distance &gt; 10) { // this solves the problem
  car.set_speed(127);
  car.forward();
  delay(3000);
}


etc
Edit: Thanks to the commenter.