Create a program that takes a string as input and encodes all special characters to their corresponding HTML entities. The program should print the encoded string to the console. Input: The input will be a string containing special characters. Output: The output will be the encoded string with special characters replaced with their HTML entities.
Example 1
Input: Hello & World
Output: Hello & World
The program encodes the `&` character to its HTML entity `&`
Constraints
Hints
Create a program that takes a string as input and encodes all special characters to their corresponding HTML entities. The program should print the encoded string to the console. Input: The input will be a string containing special characters. Output: The output will be the encoded string with special characters replaced with their HTML entities.
Example 1
Input: Hello & World
Output: Hello & World
The program encodes the `&` character to its HTML entity `&`
Constraints
Hints