Segmentation fault

This code is working fine on coding blocks ide but giving seg fault here

@hemantomer1
Send me your code in a CB ide link.

@hemantomer1

This is the updated code. Please revert in case you face any difficulty.