Posts by rogger • 33 points
1 post
-
3
votes2
answers307
viewsQ: End of Java Scanner input
This C code reads integers until Control-Z is typed (end of windows entry). void main(int argc, char *argv[]) { char line[100]; int sum = 0; while(scanf("%s", line) == 1) { sum += atoi(line); }…