LCM There is a runtime error. what's wrong?

https://ide.codingblocks.com/#/s/30910
https://hack.codingblocks.com/contests/c/509/188

there is a runtime error. what’s wrong ?

https://ide.codingblocks.com/#/s/31019

I have made changes in your code and commented your mistakes. There was both syntax and logical error…