...

Exercise: Driving Age Checker

Now it's your turn to write an if/else statement! In this exercise, you'll create a program that checks if someone is old enough to drive.

Write an if/else statement that:

  • If the person is 16 or older, prints: "You can drive!"
  • If the person is younger than 16, prints: "You can't drive yet"

Hints:

  • Use the comparison operator >= to check if age is greater than or equal to 16
  • Remember the structure: if (condition) { } else { }
  • Use console.log() to print the messages

Try running your code with different ages to see how it works!

Loading...

Output (Console)