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