Solution: Fix the Errors

The main() function stores a person’s current age, calculates their age for the next year, and prints both values.

  • Declares an integer variable age with the value 19 to represent the current age.

  • Declares another integer variable nextYear and assigns it age + 1 to calculate the age for the next year.

  • Uses cout to print "You are 19 years old."

  • Prints another line showing the next year’s age: "Next year you'll be 20"

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

Solution: Fix the Errors

The main() function stores a person’s current age, calculates their age for the next year, and prints both values.

  • Declares an integer variable age with the value 19 to represent the current age.

  • Declares another integer variable nextYear and assigns it age + 1 to calculate the age for the next year.

  • Uses cout to print "You are 19 years old."

  • Prints another line showing the next year’s age: "Next year you'll be 20"

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