If else loop is getting skipped and only else statement is getting executed.

In the following code only the else statement is getting executed and if, else if statements are jumped. If the else statement is removed still the if, else if statements are skipped. Can someone please provide me a solution for this

#define S0 4
#define S1 5
#define S2 6
#define S3 7
#define sensorOut 8

signed int R = 0;
signed int G = 0;
signed int B = 0;

int frequency = 0;
void setup() {
pinMode(S0, OUTPUT);
pinMode(S1, OUTPUT);
pinMode(S2, OUTPUT);
pinMode(S3, OUTPUT);
pinMode(sensorOut, INPUT);

digitalWrite(S0,HIGH);
digitalWrite(S1,LOW);

Serial.begin(9600);
}
void loop() {

digitalWrite(S2,LOW);
digitalWrite(S3,LOW);

frequency = pulseIn(sensorOut, LOW);

Serial.print("R= ");
Serial.print(frequency);
Serial.print(" ");
delay(200);

//frequency scale 100%
digitalWrite(S2,HIGH);
digitalWrite(S3,HIGH);

frequency = pulseIn(sensorOut, LOW);

Serial.print("G= ");
Serial.print(frequency);
Serial.print(" ");
delay(200);

digitalWrite(S2,LOW);
digitalWrite(S3,HIGH);

frequency = pulseIn(sensorOut, LOW);

Serial.print("B= ");
Serial.print(frequency);
Serial.println(" ");
delay(200);

if (((R <=37) && (R >=35)) || ((B>= 22) && (B<=23)) || ((G<=82) && (G>=79)))
{
Serial.println(" - ( Detected color is A)");
}
else if (((R<=160) && (R >=140)) && ((B>= 95) && (B<=120)) && ((G<=390) && (G>=360)))
{
Serial.println(" - ( Detected color is B)");
}
else if (((R<=50) && (R >=46)) || ((B>= 35) && (B<=38)) || ((G<=166) && (G>=154)))
{
Serial.println(" - ( Detected color is C)");
}
else if (((R<=56) && (R >=50)) || ((B>= 41) && (B<=43)) || ((G<=194) && (G>=184)))
{
Serial.println(" - ( Detected color is D)");
}
else if (((R<=130) && (R >=90)) || ((B>= 120) && (B<=180)) || ((G<=370) && (G>=300)))
{
Serial.println(" - ( Detected color is E )");
}
else
{
Serial.println(" - ( No color detected)");
}
}

In the following code only the else statement is getting executed

That implies that none of the preceding tests return true

What do you see when you print the value of the variables that you are testing ?
Where do you set the values of R, G and B in the program before testing them ?

Given that R, G and B are all zero, what do you think SHOULD be happening?

Regards,
Ray L.

Generally, when you print an identifier and a variable, it is a good idea to make sure that the variable you are printing is the same variable that you say you are printing.

You are not doing that.