https://ide.codingblocks.com/#/s/31239
error- segmentation error 11
There would be && instead of or in line 88. It resolves the runtime error. Even then the output is wrong. There is mistake in your logic. Try to correct it.