int main(int argc, char* argv[]) { FILE *fp = fopen(argv[1], "r"); char ch[20]; char *cp=NULL; if(fp==NULL) { printf("error \n"); } else{ while(fgets(ch,20,fp)) { cp=strtok(ch,","); if(cp!=NULL){ cp=strtok(NULL,"\n"); } primecount(atoi(ch),atoi(cp)); } } fclose(fp); return 0; }
int main(int argc, char *argv[]) { double start,finish,result,precise; setDefaults(getSel(argc,argv)); printf(" -> Starting sequence with %ld ...\n",maxval); start = getCurrTime(); primecount(maxval); finish = getCurrTime(); result = (finish - start)/lts2; //printf("\nResult is: %6.3lf.\n",result); precise = abs(lts1 - result); printf("\nResult is: %6.3lf.\n",precise); return (int)(result/1); }