There are several problems with the code.
First, as already been noted, fflush(stdin) is undefined behavior. Although its behavior for input stream might be documented for a particular implementation (with glibc, fflush(stdin) flushes unread input), this is not portable behavior.
Removing fflush() won't be enough. If scanf() gets a format specification like '%lF', and after skipping any whitespace in the input stream the next character will not be convertible to the requested format specification (it's not a digit, a decimal point, or +/- sign for the '%lF' format specification, for example) the next character actually remains unread, and if there are no other format specifications that have been successfully converted, scanf() would return 0. If you loop around again, the unread character will still not be convertible, so you end up with an infinite loop.
I never liked using scanf(), because handling this kind of an error condition was always awkward.
I prefer to use fgets(), to read the entire line of input into a buffer, and, if you insist, use sscanf() to parse it. With that approach, the error recovery semantics will be easy to implement.