QUESTION IMAGE
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
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.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
False