infinite loop kicks in

This is a discussion on infinite loop kicks in within the C Programming forums, part of the General Programming Boards category; I can't see what's wrong here, any idea why when I enter q ( which should jump out of the ...

You are scanning a float and then testing it for a character value? That just won't work.
You will have to either:
-scan a 'q' and test it for the value that scanf returns when expecting a float, and then use this value in place of the current 'while' condition,
-use fgets, and test it for q, then transform it with a call to atof, (which is probably better, anyway).

And actually, since in this case, we know noone will enter '0' for a price, we can exploit the fact that atof returns 0 if a char-containing string is passed into it.