0

#include <stdio.h> #include <cs50.h> int main(void) { //Prompt for start size int start; do { start = get_int("start: "); } while (start < 9 ); // Prompt for end size int end; do { end = get_int("end: "); } while (end < start);}

//ToDo: Calculate number of years int n = start; int years = 0; while (n < end); { n = n + n/3 - n/4; years++; } //ToDo: Print number of years printf("years: %i\n", years); }

population.c:20:10: error: use of undeclared identifier 'start' int n = start; ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 2 errors generated. make: *** [: population] Error 1 population/ $

1 Answer 1

0

You have a stray closing curly brace on line 17. It closes out main.

while (end < start);}

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

You must log in to answer this question.

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