[URGENT] Error Msg on Code: "expected unqualified-id before 'if' "

Hi,
Im working on this project. I need to submit it very soon. I wrote the code but Im getting this error msg.

Error Msg: AUBO:122: error: expected unqualified-id before 'else'

else if ( distance > 20 || slow = 1 )

^

AUBO:126: error: expected unqualified-id before 'else'

else if ( distance < 20 || norm = 1 )

^

AUBO:131: error: expected unqualified-id before 'else'

else if ( distance > 20 || norm = 1 )

^

AUBO:135: error: expected declaration before '}' token

}

^

exit status 1
expected unqualified-id before 'if'

Then here's the code -
// AUBO v0.3
// by Vedaant Yadav

const int UTrig = 3;
const int UEcho = 2;
const int motorA1 = 5;
const int motorA2 = 6;
const int motorB1 = 9;
const int motorB2 = 10;

int duration = 0;
int distance = 0;
int start = 0;
int slow = 0;
int norm = 0;
int state = 'S';
int vSpeed = 100;
void setup()
{
pinMode(UTrig , OUTPUT);
pinMode(UEcho , INPUT);
pinMode(motorA1 , OUTPUT);
pinMode(motorA2 , OUTPUT);
pinMode(motorB1 , OUTPUT);
pinMode(motorB2 , OUTPUT);

Serial.begin(9600);

}

void loop()
{
if (start == 0) {
delay (10000);
if (distance < 5) {
int norm = 1;
}
else if (distance > 5) {
int slow = 1;
}
}
}

if (norm == 1) {
int vSpeed = 230;
}
else if (slow == 1) {
int vSpeed = 80;
}

/Forward*****/
//If state is equal with letter 'F', car will go forward!
if (state == 'F') {
analogWrite(motorA1, vSpeed); analogWrite(motorA2, 0);
analogWrite(motorB1, 0); analogWrite(motorB2, 0);
}
/Forward Left**/
//If state is equal with letter 'G', car will go forward left
else if (state == 'FL') {
analogWrite(motorA1, vSpeed); analogWrite(motorA2, 0);
analogWrite(motorB1, 200); analogWrite(motorB2, 0);
}
/Forward Right**/
//If state is equal with letter 'I', car will go forward right
else if (state == 'FR') {
analogWrite(motorA1, vSpeed); analogWrite(motorA2, 0);
analogWrite(motorB1, 0); analogWrite(motorB2, 200);
}
/Backward*****/
//If state is equal with letter 'B', car will go backward
else if (state == 'B') {
analogWrite(motorA1, 0); analogWrite(motorA2, vSpeed);
analogWrite(motorB1, 0); analogWrite(motorB2, 0);
}
/Backward Left**/
//If state is equal with letter 'H', car will go backward left
else if (state == 'BL') {
analogWrite(motorA1, 0); analogWrite(motorA2, vSpeed);
analogWrite(motorB1, 200); analogWrite(motorB2, 0);
}
/Backward Right**/
//If state is equal with letter 'J', car will go backward right
else if (state == 'BR') {
analogWrite(motorA1, 0); analogWrite(motorA2, vSpeed);
analogWrite(motorB1, 0); analogWrite(motorB2, 200);
}
/Left**/
//If state is equal with letter 'L', wheels will turn left
else if (state == 'L') {
analogWrite(motorA1, 0); analogWrite(motorA2, 0);
analogWrite(motorB1, 200); analogWrite(motorB2, 0);
}
/Right**/
//If state is equal with letter 'R', wheels will turn right
else if (state == 'R') {
analogWrite(motorA1, 0); analogWrite(motorA2, 0);
analogWrite(motorB1, 0); analogWrite(motorB2, 200);
}
/Stop*****/
//If state is equal with letter 'S', stop the car
else if (state == 'S'){
analogWrite(motorA1, 0); analogWrite(motorA2, 0);
analogWrite(motorB1, 0); analogWrite(motorB2, 0);
}

digitalWrite(UTrig , HIGH);
delayMicroseconds(1000);
digitalWrite(UTrig , LOW);

duration = pulseIn(UEcho , HIGH);
distance = (duration/2) / 28.5 ;
Serial.println(distance);

if ( distance < 20) ||slow = 1)
{
int state = 'L'
delay(100);
}
else if ( distance > 20 || slow = 1 )
{
int state = 'F'
}
else if ( distance < 20 || norm = 1 )
{
int state = 'L'
delay(100);
}
else if ( distance > 20 || norm = 1 )
{
int state = 'F'
}
}

Please its urgent. Any help is apprecited.
Thanks,
Vedaant

Missing braces.

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:

[code]

[color=blue]// your code is here[/color]

[/code]

Using code tags and other important information is explained in the How to use this forum post. Please read it.

Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read. If you're using the Arduino Web Editor you will not have access to this useful tool but it's still unacceptable to post poorly formatted code. I recommend you to use the standard IDE instead.

After the Auto Format, take a close look at the resulting indentation of your code. Does it match the intended program structure? If not, can you see why?

vedaant:

if ( distance < 20) ||slow = 1)

Please take some time to research the difference between the assignment operator (=) and a comparison operator (==).
See:

Thank you so much
Ill remember next time.

Also, int state = 'L'; // missing semicolon, line 122.
Lines 126, 131 as well.

Then you've got the scope issues

 else if ( distance > 20 || norm = 1 )
              {
                int state = 'F'
              }

if (state == 'BR')It's not impossible, but it is unusual.