It's not loosing precision, it never had it in the first place. If you work out what the binary representation of 30.15 you'll find out that it's represented as something a bit less than 30.15 for the number of bits you've got in a float. In fact as 0.15 is not a fraction that can be represented by summing successive powers of 0.5 you'll never get get the sort of precision you're after.
So what can you do about it?
Well one thing you could do is use a data type that doesn't loose precision, e.g. a pair of ints. So you'd read in using something like:
int whole_part = 0;
int hundredths = 0;
scanf( "%d.%d", &whole_part, &hundredths );
int temp = whole_part * 100 + hundredths;
Basically the moral is floating point numbers in the real world are approximations (e.g. when you write 30.15 you're actually saying "a number in the half open range 30.145 to 30.155") and computers are no different. So don't use them when you need a lot of precision, use fixed point numbers where you can or at least know how they work so you can fix problems when they happen.
Cheers,
Ash
PS: Remember to check the return value of scanf and you'll want to declare temp at the start of a block, not after carrying out some other statements the way I have.