Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

question: 5 what is the value of the boolean variable canvote at the en…

Question

question: 5
what is the value of the boolean variable canvote at the end of this program?
var age = 17;
var iscitizen = true;
var canvote = age >= 18 && iscitizen;
true
false
yes
none, there is a syntax error in this code

Explanation:

Step1: Analyze age >= 18

Given age = 17, so \(17\geq18\) is false.

Step2: Analyze logical AND (&&) operation

The && operator requires both operands to be true for the result to be true. Here one operand (age >= 18) is false.

Answer:

False