Https://ide.codingblocks.com/s/322572

why is it giving me segmentation fault, please check it and help me find errors, have been stuck with it since morning

Check ur first for loop in main function. It is an infinite loop