Answer:
The source code and output is attached.
I hope it will help you!
Step-by-step explanation:
8.6m questions
11.2m answers