Re: whats wrong with my decimal input
- From: "Jay Daniel" <Phaze426SPAMBOX@xxxxxxxxx>
- Date: 12 Sep 2005 14:42:41 -0700
TallGlass,
You didn't do quite enough scouring. You've defined "rate" as an
integer and read it in as such. Thus, there's no way scanf is going to
let you enter a decimal point in it. Change your definition "int
rate=0;" to "float rate=0.0F" and the line "scanf("%d",&rate)" to
"scanf("%f",&rate)" and things will work like you expect.
Somehow you must have been headed in this direction as you're
casting rate to a float in your computation.
-Jay
.
- References:
- whats wrong with my decimal input
- From: TallGlass
- whats wrong with my decimal input
- Prev by Date: Re: Output a string to the default printer
- Next by Date: Re: calling dll from c like app
- Previous by thread: whats wrong with my decimal input
- Next by thread: Re: whats wrong with my decimal input
- Index(es):
Relevant Pages
|
Loading