Greetings, I need assistance writing a program that can check an HTML document for proper opening and closing tags.

Greetings, I need assistance writing a program that can check an HTML document for proper opening and closing tags.
<html><head><title>Example</title></head> <body><h1>Hello, world</h1></body></html>

"Get 15% discount on your first 3 orders with us"
Use the following coupon
"FIRST15"

Order Now