Pattern Magic Run time error

My results are okay but it is showing run time error.

There are various reasons of getting Run time error while submitting on online ide. It is recommended to use int main() and return 0; at the end, not using it can be a possible reason for run time error.
Also please give the link of your solution so that I can review it. Thanks