Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C programming help: My code almost works, I am having trouble with how to make the loop continue for 1 more iteration after it hits

C programming help:
My code almost works, I am having trouble with how to make the loop continue for 1 more iteration after it hits the condition. I set the condition for 100,000 but need it to continue for 1 more time after it hits the coniditon and then print that final result as the last line.
image text in transcribed
image text in transcribed
Read in two variables, year and population. Each year the population increases by 10%. Write a program that displays the annual population and stops in the year when the town will count over 100,000 people for the first time. Make sure that the population is positive, non-zero. For example: Result p-87650 year-2013 Year Population Input 2013 2014 2015 87650 96415 106056 pu-4 year2013 Population must be larger than LON 10 1 #include 2 #include 3 4. int main () { 5 6 float pop, year; 7 8 scanf("p=%f year=%f", &pop, &year); 9 if (pop

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

=+ c. a company president deciding whether to open a new factory

Answered: 1 week ago