I think you should write your loop like this instead:
Incidentally, I think that SENTINAL should be SENTINEL, and you really should indent your code more consistently.Code:while (scanf("%lf", &r1) == 1 && r1 != SENTINAL) { resistance += 1.0 / r1; }