Regarding the error

getting segmentation fault

what is segmentation fault please explain

Hey @gargshivam2001
You get Segmentation fault when

  • You try to access illegal memory say arr[-1]
  • You try to allocate more memory than available