buzzer does not work with distance sensor hc-sr04

Attach the actual code you are debugging to your next post.
Use the [ code] # button you see at the top of the Text box.