Hey man..
no problem..I think I fixed the problem..you had to FLUSH at the end of the loop..the revised code is here now!
Btw..you had a typo.."availible" should be spelt "available"..I fixed that too..
If you want a better understanding of FLUSH reply back and I'll post a previous msg..Okee..
A
Code:
#include <stdio.h>
#include <stdlib.h>
#define FLUSH while(getchar() != '\n')
int main()
{
float fuel_flow;
float total_fuel;
float TAS;
char TAS1[6];
char total_fuel1[16];
char fuel_flow1[12];
char yn='y';
while(yn=='y')
{
printf("What is your fuel flow in pounds? ");
gets(fuel_flow1);
fuel_flow=(float) atoi(fuel_flow1);
printf("What is your total fuel available in pounds? ");
gets(total_fuel1);
total_fuel=(float) atoi(total_fuel1);
printf("What is your true airspeed in knots? ");
gets(TAS1);
TAS= (float) atoi(TAS1);
printf("\nEndurance: %.2f hrs\n",total_fuel/fuel_flow);
printf("Range: %.1f nm\n",total_fuel/fuel_flow*TAS);
printf("\nCalculate again? y/n ");
yn=getchar();
FLUSH;
}
printf("Done!");
return 0;
}