On Tue, Jun 28, 2011 at 1:33 AM, Jason Rumney <jas...@gnu.org> wrote: > Sayth Renshaw <flebber.c...@gmail.com> writes: > >> # include <stdio.h> >> int main() >> { >> float a,b,c,interest; >> printf("Type in amount in dollars cents:\n"); > > fflush(stdout); > >> scanf("%f",&a); >> b = 0.075; >> c = a * b; >> interest = a + c; >> printf("The total including interest is $%.2f", interest); >> return 0; >> } > > Windows automatically flushes the output before a scanf if stdout/stdin > is a console window, but it does not if they are redirected to another > program. >
Thanks heaps. I went on a big side track thinking it was an emacs issue. Sayth