0

it compiles but wrong years

#include <cs50.h>
#include <stdio.h>
int main(void)
{
    int n,e;
    do
    {
        n = get_int("Start Size:");
    } while (n < 9);

    do
    {
        e = get_int("End Size:");
    } while (e < n);

    n= n + n/3 - n/4;
    printf("Years: %i\n", n);
}

1 Answer 1

0

There is a lack of understanding of the operation of the program, your variable n is calculated only once, that is not what we are asked to do. Hint, the expression that computes n must be in a WHILE loop, with an appropriate end-of-loop condition

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .