Segmentation Fault

I am getting segmentation fault as an error when I am trying to run this program on Vim editor in mac.

Segmentation fault: 11

I have written my code on vim editor so how to provide it as a link to check the code.