What is the error in my code?

this is my prime visits code that I have written, it is not showing any output, segmentation fault is coming.
can someone please find out whats the error in the code.
i am not able to figure out.

@Usha24 i think there is some tech problem in CB ide try it in other ide it should work fine.

Not working in any ide gfg, sublime

Showing segmentation fault

try here https://ideone.com/ it is working fine, but you should comment that part where you have written cout<<csum[i] while updating csum[i].

yes it is working fine on ideone

but on sublime it shows segmentation fault for 10^6 size array but works fine for 10^5 size array, why so???

@Usha24 may be that sublime can’t handel array with bigger sizes or due to your pc’s processor.