Help with If statements

Hello,

i have aquestion in my project automatically using the ac fan relay. but I can not loop if the low temperature relay 1 remains on.
please help me

#include <Wire.h>
#include "LiquidCrystal_I2C.h"
LiquidCrystal_I2C lcd(0x27, 16, 2);

#define RELAY_ON 0
#define RELAY_OFF 1

float tempC;
int tempPin = 0;
int relay1 = 7;
int relay2 = 8;
int relay3 = 9;

void setup() {

pinMode (relay1, OUTPUT);
pinMode (relay2, OUTPUT);

digitalWrite ( relay1, RELAY_OFF);
digitalWrite ( relay2, RELAY_OFF);

lcd.begin();
lcd.setCursor(0, 0);
lcd.print("Arduino Project");
lcd.setCursor(0, 1);
lcd.print("Alat Ukur Suhu");
delay(3000); //delay 3 detik
lcd.clear();
lcd.print("Suhu Ruang Ini:");

}

void loop() {

lcd.setCursor(4, 1);
tempC = analogRead(tempPin);
tempC = (5.0 * tempC * 100.0)/1024.0;
lcd.print(tempC);
lcd.setCursor(9, 1);
lcd.print("\xdf"); //menampilkan karakter derajat
lcd.print("C"); //menampilkan karakter C
delay(2000);

if (tempC <=20 && tempC >30){

digitalWrite(relay1, RELAY_OFF);
digitalWrite(relay2, RELAY_OFF);}

if (tempC >30 && tempC <=35){
digitalWrite(relay1, RELAY_ON);
digitalWrite(relay2, RELAY_OFF);}

if (tempC >36 && tempC <40){
digitalWrite(relay2, RELAY_ON);
digitalWrite(relay1, RELAY_OFF);}
delay(2000);

tempC cannot be <=20 && >30) at the same time, also, what happens if tempC = 36?
Did you mean:
if (tempC <=30 || tempC >=40){ ?

That's it, Andreas! Outsider is completely right. tempC will never have a value less than or equal 20 AND greater than 30 at the same time (this is for the first if statement on your code). It will be either less than 32 OR greater than 30. If you want to check out whether the tempC ranges from 20 to 30 then you need to code:

if (tempC >=20 && tempC <30){
.
.
.
}