I don’t understand how there can be a segmentation fault for 2 cases while other four print correct output