From scanf reference:
On success, the function returns the number of items of the argument
  list successfully filled. This count can match the expected number of
  items or be less (even zero) due to a matching failure, a reading
  error, or the reach of the end-of-file.
If a reading error happens or the end-of-file is reached while
  reading, the proper indicator is set (feof or ferror). And, if either
  happens before any data could be successfully read, EOF is returned.
If an encoding error happens interpreting wide characters, the
  function sets errno to EILSEQ.
So, you may rewrite your do-while loop to something like
int retval;
while((retval = scanf("%f", &num)) != EOF && retval > 0 && num != 0) {
    sum += num;
}
if(retval == 0) {
    printf("input read error.\n");
}
to match your constraints.
Also note you need to prefix your variable with & when passing it to scanf(), since the function expects a pointer to deal with (you need to pass variable address).
EDIT:
see this topic concerning EOF problems in Windows