John is creating a game and needs a variable to store whether a player is alive or dead. Which data type is most appropriate for this purpose?

  • bool
  • char
  • decimal
  • double
John should use the 'bool' (boolean) data type. Booleans are binary, representing either 'true' or 'false'. They are perfect for storing states like 'alive' or 'dead' in a game, allowing for simple condition checks.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *