How to resolve the segmentation fault runtime error? I am getting it again and again despite making changes to my code. This in reference to the last question of the practice problems. link:http://www.codechef.com/problems/easy
My code is as follows: int main() { int i=0; int a[10];
for(i=0;i<10;i++) scanf("%d",a[i]);
for(i=0;i<10;i++) { while(a[i]!=42) { printf("%d",a[i]); printf("\n");}} return 0; }