2009-09-24, 09:16 PM
ok, well, don't fully know the terms you are using since im pretty noob at programming.
this is what ive got
it keeps returning just - (numBactDie) and dont know why
this is what ive got
Code:
int main(void) {
double numBact;
double growthRate;
double numBactAfter;
int numBactDie;
int numDays;
int stop;
int dayPrint = 0;
printf("How many bacteria are there on day one?\n");
scanf("%f", &numBact);
printf("What is their growth rate?\n");
scanf("%f", &growthRate);
printf("How many bacteria die each day?\n");
scanf("%d", &numBactDie);
printf("How many days will you grow the bacteria?\n");
scanf("%d", &numDays);
printf("Day | Number of Bacteria\n");
while (dayPrint < numDays){
dayPrint = dayPrint + 1;
printf("%d | %f\n", dayPrint, numBact);
numBact = growthRate * numBact - numBactDie;
}
return (0);
}it keeps returning just - (numBactDie) and dont know why

