- #include <cs50.h>
- #include <stdio.h>
- int main(void)
- {
- // TODO: Prompt for start size
- int n = get_int("Enter the popuation:");
- // TODO: Prompt for end size
- int endsize = get_int("Enter end size:");
- int m = 0;
- // TODO: Calculate number of years until we reach threshold
- do
- {
- n = (n + (n / 3) - (n / 4));
- if
- (n > endsize);
- else
- m = ( m + 1 );
- }
- while (n <= endsize);
- printf ("%d\n",m);
- }
[text] 111
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new:
File Description
- 111
- Paste Code
- 18 Sep-2021
- 469 Bytes
You can Share it: