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