Booleans Practice Quiz¶
Question 1¶
boolean-quiz1: What will the be the output of the following code?:
let beta = true;
let gamma = false;
let delta = true;
let epsilon = false;
if (beta && epsilon) {
console.log("boat");
} else if (gamma || delta) {
console.log("car");
} else {
console.log("train");
}
Question 2¶
boolean-quiz2: What will the be the output of the following code?:
let beta = true;
let gamma = false;
let delta = true;
let epsilon = false;
if (beta && !epsilon) {
console.log("boat");
} else if (!gamma || delta) {
console.log("car");
} else {
console.log("train");
}
Question 3¶
boolean-quiz3: What will the be the output of the following code?:
let beta = true;
let gamma = false;
let delta = true;
let epsilon = false;
if (!beta && delta || gamma) {
console.log("boat");
} else if (!gamma || delta && epsilon) {
console.log("car");
} else {
console.log("train");
}
Question 4¶
boolean-quiz4: What will the be the output of the following code?:
let beta = true;
let gamma = false;
let delta = true;
let epsilon = false;
if (gamma && !epsilon || beta && !delta) {
console.log("boat");
} else if (!gamma && epsilon || delta && gamma) {
console.log("car");
} else {
console.log("train");
}
Question 5¶
boolean-quiz5: What will the be the output of the following code?:
let beta = true;
let gamma = false;
let delta = true;
let epsilon = false;
if (!gamma || (epsilon && !epsilon || beta && !delta && gamma || !delta)) {
console.log("boat");
} else if (gamma || !epsilon) {
console.log("car");
} else {
console.log("train");
}