Solution: Personal Profile

The main() function declares variables of different data types (char, int, and double) and prints a formatted introduction message.

  • Declares a character variable n with the value 'A' to represent an initial.

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

  • Declares a double variable height with the value 1.74 to store height in meters.

  • Uses cout to print all three variables together in a single sentence:
    "Hi, I am Mr. A, I'm 19 years old and 1.74 meters tall!"

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

Solution: Personal Profile

The main() function declares variables of different data types (char, int, and double) and prints a formatted introduction message.

  • Declares a character variable n with the value 'A' to represent an initial.

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

  • Declares a double variable height with the value 1.74 to store height in meters.

  • Uses cout to print all three variables together in a single sentence:
    "Hi, I am Mr. A, I'm 19 years old and 1.74 meters tall!"

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