Problem whit IF/ ELSE function

So I have writen this program and I have a problem whit else function. It gives me error: ‘else’ without a previous ‘if’. I dont know what is wrong ?

#include <LiquidCrystal.h>
int fan = 7;              //determine fan pin 
int redled=8;             //determine red led pin
LiquidCrystal lcd(12, 11, 6, 5, 4, 2);      //determine ti which pins is connecte LCD
#define pwm 9 ;

void setup()

{                                   //determine which pin are input or output 
  pinMode(fan,OUTPUT);
  pinMode(redled, OUTPUT);
lcd.begin(16, 2);

  lcd.setCursor(6,1);
  lcd.print("HELLO!");
  lcd.setCursor(7,2);
  lcd.print(":)"); 
  delay (120);
  lcd.clear();
  Serial.begin(9600);
  lcd.setCursor(3,2);
  lcd.print("Tadej Ahac 5f");
}




void loop()


{
int  sensor=digitalRead(A0);      //Read sensor value
if(pulseIn(sensor,LOW,90000));    // If input puls is Low for 90000 microseconds
{
analogWrite(fan, 24.5);       // On the outpin sets PWM 24.5
lcd.setCursor(1,1);
lcd.print("FAN 10%");        // On the LCD writes speed of the fan
}
else                              //if criterion is not met than
{
analogWrite(fan, 0);    // turn off fan
lcd.setCursor(1,1);
lcd.print("FAN OFF");    // Write on the LCD that the fan is off
}

if (pulseIn(sensor,LOW, 80000)); // If input puls is Low for 80000 microseconds
analogWrite(fan, 51);     // On the outpin sets PWM 51

lcd.setCursor(1,1);
lcd.print("FAN 20%");  // On the LCD writes speed of the fan

else 
{
analogWrite(fan, 0);
lcd.setCursor(1,1);
lcd.print("FAN OFF");
}

if (pulseIn(sensor,LOW, 70000));
analogWrite(fan, 76.5);
lcd.setCursor(1,1);
lcd.print("FAN 30%");

else 
{
analogWrite(fan, 0);
lcd.setCursor(1,1);
lcd.print("FAN OFF");
}

}
if(pulseIn(sensor,LOW,90000));

Lose the semicolon

(I wish Android had keyboard macros)

if (pulseIn(sensor,LOW, 80000)); // If input puls is Low for 80000 microseconds
analogWrite(fan, 51);     // On the outpin sets PWM 51

lcd.setCursor(1,1);
lcd.print("FAN 20%");  // On the LCD writes speed of the fan

else 
{

Need more { and }

(And less semicolon)

So I have changed it and look like this now but at the last line it still gives me the same error.

#include <LiquidCrystal.h>
int fan = 7;              //dolčimo izhodni pin za ventilator
int redled=8;             //določimo pin rdeče led diode
LiquidCrystal lcd(12, 11, 6, 5, 4, 2);      //Določimo na katerih pinih je priključen LCD
#define pwm 9 ;

void setup()

{                                   //določimo na keteri pini so vhodni in kateri izhodni
  pinMode(fan,OUTPUT);
  pinMode(redled, OUTPUT);
lcd.begin(16, 2);

  lcd.setCursor(6,1);
  lcd.print("HELLO!");
  lcd.setCursor(7,2);
  lcd.print(":)"); 
  delay (120);
  lcd.clear();
  Serial.begin(9600);
  lcd.setCursor(3,2);
  lcd.print("Tadej Ahac 5f");
}




void loop()


{
int  sensor=digitalRead(A0);

if
(pulseIn(sensor,LOW,90000));
{
analogWrite(fan, 24.5);
lcd.setCursor(1,1);
lcd.print("FAN 10%");
}
else 
{
analogWrite(fan, 0);
lcd.setCursor(1,1);
lcd.print("FAN OFF");
}

if 
(pulseIn(sensor,LOW, 80000));
{
analogWrite(fan, 51);
lcd.setCursor(1,1);
lcd.print("FAN 20%");
}

else 
{
analogWrite(fan, 0);
lcd.setCursor(1,1);
lcd.print("FAN OFF");
}

if 
(pulseIn(sensor,LOW, 70000));
{
analogWrite(fan, 76.5);
lcd.setCursor(1,1);
lcd.print("FAN 30%");
}
else 
{
analogWrite(fan, 0);
lcd.setCursor(1,1);
lcd.print("FAN OFF");
}
}
if
(pulseIn(sensor,LOW,90000));

didn't you read what I wrote?

So now lost as many semicolons as i could and aded more { }

#include <LiquidCrystal.h>
int fan = 7;              //dolčimo izhodni pin za ventilator
int redled=8;             //določimo pin rdeče led diode
LiquidCrystal lcd(12, 11, 6, 5, 4, 2);      //Določimo na katerih pinih je priključen LCD
#define pwm 9 ;

void setup()

{                                   //določimo na keteri pini so vhodni in kateri izhodni
  pinMode(fan,OUTPUT);
  pinMode(redled, OUTPUT);
lcd.begin(16, 2);

  lcd.setCursor(6,1);
  lcd.print("HELLO!");
  lcd.setCursor(7,2);
  lcd.print(":)"); 
  delay (120);
  lcd.clear();
  Serial.begin(9600);
  lcd.setCursor(3,2);
  lcd.print("Tadej Ahac 5f");
}




void loop()


{
int  sensor=digitalRead(A0);

if(pulseIn(sensor,LOW,90000));
{
analogWrite(fan, 24.5);
lcd.setCursor(1,1);
lcd.print("FAN 10%");
}else {
analogWrite(fan, 0);
lcd.setCursor(1,1);
lcd.print("FAN OFF");
}
if(pulseIn(sensor,LOW, 80000));
{
analogWrite(fan, 51);
lcd.setCursor(1,1);
lcd.print("FAN 20%");
}else {
analogWrite(fan, 0);
lcd.setCursor(1,1);
lcd.print("FAN OFF");
}
if (pulseIn(sensor,LOW, 70000));
{
analogWrite(fan, 76.5);
lcd.setCursor(1,1);
lcd.print("FAN 30%");
}else {
analogWrite(fan, 0);
lcd.setCursor(1,1);
lcd.print("FAN OFF");
}
}
if(pulseIn(sensor,LOW,90000));

LOSE THE SEMICOLON

Dose not help it dose not matter how much semicolons i have and where it always gives me the same error . This is weird.

Do you know what a semicolon is?

It is one of these ;

It should not come after an if(), which is why I told you to LOSE IT.

Sorry I thgout semicolon is a line. It is working fine now. Thank you for hepl.

A line is a line, a semicolon is a semicolon.