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
Re:
[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?? |