This code is showing segmentation fault

and sir also please explain why does this segmentation fault occurs