Your program should behave per the examples below.
$ ./population
Start size: 1200
End size: 1300
Years: 1
$ ./population
Start size: -5
Start size: 3
Start size: 9
End size: 5
End size: 18
Years: 8
$ ./population
Start size: 20
End size: 1
End size: 10
End size: 100
Years: 20
$ ./population
Start size: 100
End size: 1000000
Years: 115
int main (void)
{
int i = start_int();
int j = end_int(i);
int h = calculate(j,i);
printf("%i", h);
}
./population
set starting population size: 9
set ending population size: 900
1~/ $
#include <cs50.h>
#include <stdio.h>
int get_number(void);
int main(void)
{
int n;
do
{
n=get_int ("set up a size population:");
}
while ((n = get_int("it should be more than 9: ")) < 9);
{
return n;
}
}
#include <cs50.h>
#include <stdio.h>
int get_number(void);
int main(void)
{
int n;
do
{
n=get_int ("set up a size population:");
}
while (n< 9);
{
printf ("it should be equal or greater than 9:")
return n;
}
}
while ((n = get_int("it should be more than 9: ")) < 9);
#include <cs50.h>
#include <stdio.h>
int get_number(void);
int main(void)
{
int i=get_number();
}
int get_number(void)
{
int n;
do
{ n= get_int("set a starting population size ");
}
while (n<9);
printf("it should be greater than or equal to 9");
return n;
}