I’m having trouble solving this | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I’m having trouble solving this

function main() { var age = parseInt(readLine(), 10) // Your code here var x = 18; // age >= x will return true }

18th May 2021, 4:10 AM
Julius Gomes
1 Answer
0
">=" is not an assignment operator. It is a conditional operator. So, if you want, age >= x to return true. You must use an if condition, or you must specify the datatype of age as a boolean, or print it.
18th May 2021, 9:03 AM
Arun Bhattacharya
Arun Bhattacharya - avatar