Solution: Favorite Color Message

The main() function stores a person's name and favorite color using string variables, then prints a personalized message.

  • Declares a string variable name with the value "Jordan" to store the person’s name.

  • Declares another string variable color with the value "blue" to store the favorite color.

  • Uses cout to print both variables together in a sentence:
    "Hey Jordan, your favorite color is blue!"

  • Ends with return 0; to indicate successful program completion.

Solution: Favorite Color Message

The main() function stores a person's name and favorite color using string variables, then prints a personalized message.

  • Declares a string variable name with the value "Jordan" to store the person’s name.

  • Declares another string variable color with the value "blue" to store the favorite color.

  • Uses cout to print both variables together in a sentence:
    "Hey Jordan, your favorite color is blue!"

  • Ends with return 0; to indicate successful program completion.