I am trying to create a program and it works perfectly except the program ignores my loop. Here is the piece of the code that this involves:
The problem I'm having is that the program simply ends after the number of desired generations is indicated. Is this because I cannot ask the loop to execute for the number of generations? If so, how would I be able to make that happen?
Code:
printf("Please indicate how many generations you wish to calculte: ");
scanf("%d", &generations);
for(n=1; n==generations; n++)
{
Population=initial*exp (growth*(1.0-(initial/capacity)));
printf("The population at the next generation will be: %.6f\n", Population);
initial=Population;
}
return(0);
}
The problem I'm having is that the program simply ends after the number of desired generations is indicated. Is this because I cannot ask the loop to execute for the number of generations? If so, how would I be able to make that happen?
Comment