why wont this loop exit after I have typed a negative number?
Code:int main() { int scores[10]={0,0,0,0,0,0,0,0,0,0}; int ids[10]={0,0,0,0,0,0,0,0,0,0}; int i; for(i=0;i<10;i++) printf("scores are %i\nand IDS are %i\n\n", scores[i], ids[i]); i=0; while(ids[i]>=0) { scanf("%i", &ids[i]); printf("scores are %i\nand IDS are %i\n\n", scores[i], ids[i]); i++; } system("pause"); return 0; }