Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #54.9K
~73 People Reached
Favorite Forums
Favorite Tags
c x 3
Member Avatar for illuminatus89

[CODE]#include<stdio.h> #define ARSIZE 1000000 int main() { int i=0,j=0,c=0,k,n; int prep[ARSIZE]; for(i=0;i<1000000;i++) { j++; for(k=2;k<j;k++) { if(j%k==0) c++; } if(c==2) prep[i]=j; c=0; } printf("Enter N : "); scanf("%d\n",&n); printf("%d",prep[n-1]); getch(); return 0; } [/CODE] why is this code giving segmentation fault??

Member Avatar for vikashj
0
73