Write a program called population.c that determines howlong it will take a town\
ID: 3614723 • Letter: W
Question
Write a program called population.c that determines howlong it will take a town's population to reach a certain size. Yourprogram will ask the user for two values: a starting population andan ending population. Assuming that the population increases by 10percent each year, your program should use a loop to determine howmany years it will take for the population to surpass the specifiedending population. Output this result to the user. Your programshould have a function that prompts the user for input and afunction that computes the number of years.Explanation / Answer
please rate - thanks #include #include void input(double*,double*); int compute(double,double); int main() {double start,end; int years; input(&start,&end); years=compute(start,end); printf("It will take %d years to achieve thepopulation ",years); getch(); return 0; } void input(double *start, double* end) { printf("Enter starting population: "); scanf("%lf",start); printf("Enter ending population: "); scanf("%lf",end); } int compute(double s,double e) {int i=0; while(sRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.