Answer:
The corrected source code and output is attached including comments where are the mistakes.
Step-by-step explanation:
I hope it will help you!
5.1m questions
6.7m answers