giving segmentation fault while running the code code: https://ide.codingblocks.com/s/214704
I have edited your code… Try to submit it now…