Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

lab1 answer

Cruel Cowfish answered on March 9, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • practical1_answer
  • lab 1

  • lab1 answer

    0

    #include

    #include

    int main(void)

    {

    // TODO: Prompt for start size

    int start, end;

    do

    {

    start = get_int("Start size: ");

    }

    while (start < 9);

    // TODO: Prompt for end size

    do

    {

    end = get_int("End size: ");

    }

    while (end <= start);

    // TODO: Calculate number of years until we reach threshold

    int years, born, died;

    years = 0;

    while (start < end) {

    born = start / 3;

    died = start / 4;

    start = start + born - died;

    years++;

    }

    // TODO: Print number of years

    printf("Years: %i\n", years);

    Popularity 1/10 Helpfulness 1/10 Language whatever
    Tags: whatever
    Link to this answer
    Share Copy Link
    Contributed on Mar 09 2023
    Cruel Cowfish
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.