void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
int temperature = 35;
//conditions
if (temperature == 20){
Serial.println("OK"); //only excecuted if condition is met
}
if(temperature >= 30){
Serial.println("SUPER OK");
}
if(temperature <= 30){
Serial.println("NOT OK");
}
if((temperature >=20) && (temperature < 30)){
Serial.println("MAYBE OK"); //only excecuted if both conditions are met
}
if((temperature >= 20) || (temperature < 10)){
Serial.println("IS IT OKAY?"); //excecuted if either condition is met
}
if(temperature == 40){
Serial.println("DEFINITELY OK");
}
else if (temperature == 35){
Serial.println("COULD STILL BE OK"); //excecuted if the first condition is not met
}
else{
Serial.println("WHAT HAPPENED?"); //excecuted if no conditions are met
}
}
void loop() {
// put your main code here, to run repeatedly:
}