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