1

#include <cs50.h> #include <stdio.h>

int main(void) { int n; int End; // TODO: Prompt for start size do { n = get_int("Start size: "); } while ( n < 9);

// TODO: Prompt for end size do { End = get_int("End size: "); } while (End < n); // TODO: Calculate number of years until we reach threshold int years = 0; while (n < End) { n = n + (n / 3) - (n / 4); years++; } // TODO: Print number of years printf("Years: %i\n", years); } strong text

0

You must log in to answer this question.

Browse other questions tagged .