Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need large amount of help for C Programming classwork
#6
ok, well, don't fully know the terms you are using since im pretty noob at programming.

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
Reply


Messages In This Thread
Need large amount of help for C Programming classwork - by Sivrat - 2009-09-24, 09:16 PM

Forum Jump:


Users browsing this thread: