This might help u ...
First of all what are u trying to calculate or whats the formula??? ..Well i have fixed every thing execpt the formula ...i mean ur calculation its wrong .... check it and make it correct sfter that every thing will work fine....
float bal,rate,take, new_bal;/* dont use new as a variable name.Because its a keyword*/
printf( "Enter an opening balance: " );
scanf( "%f",&bal );
printf( "Enter an interest rate: " );
scanf( "%f" ,&rate );
printf( "Enter an amount to be withdrawn each year: ");
scanf( "%f",&take );
printf("%4s%10s%12s%13s%15s", "Year","Amount","Interest","Withdrawn","New Balance");
printf( "\n" );
while ( new_bal > 0 )
new_bal=bal*(1+rate)-take; /* Your formula is wrong*/
bal = new_bal;
printf (" The years it took to empty the account %d", count );
okay if u execute it ...its gonna go in an infinite loops thats because ur calculation is wrong.. if u wanna c how the program work ...In the while statment remove (new_bal > 0 ) and put ( count != 10 )..The problem is that the formula u used just keeps on incresing but not decreasing so it will never come to zero...