Can u plz tell me where i am wrong in this code?

check its working for n>m

when n == m
then also segmentation fault is shown


simple and concise code