From: Andrew Crabtree Message-Id: <199707200253.AA059677223@typhoon.rose.hp.com> Subject: Re: Long Question-Don't take a long time to answer To: thedarkage AT mail DOT geocities DOT com (Guilherme Silveira) Date: Sat, 19 Jul 1997 19:53:42 PDT Cc: djgpp AT delorie DOT com In-Reply-To: <3.0.32.19970719140218.006ec000@mail.geocities.com>; from "Guilherme Silveira" at Jul 19, 97 9:48 pm Precedence: bulk and I got an the folowing (2), do you know why? Yes - the code you are not showing us has bugs in it ;) > float a=0; > float b=0; > float c=0; > a=375; > b=150; > c=a/b; > (2) > I got: c=2 If you enter just the code you have entered here gcc will optimize out all of the variables and division, and just push an immediate value of 2.5 on the stack (assuming you call printf or something). > This return is 'cause '/' returns only an integer. (I think so). Nope. Not unless you are using integer values or are coercing the value with (int) a/b). try this #include int main(void) { float a,b,c; printf("Enter a float\n"); scanf("%f",&a); printf(Enter another float\n"); scanf("%f",&b); c = a/b; printf("float 1/float 2 = %f\n",c); return 0; } Andrew