Q23 Population of a town today is 100000. The population has increased steadily at the rate of 10% per year for last 10 years. Write a program to determine the population at the end of each year in the last decade.

Program: 116

Population of a town today is 100000. The population has increased steadily at the rate of 10% per year for last 10 years. Write a c program to determine the population at the end of each year in the last decade.

Output:

1 year: 90000
2 year: 81000
3 year: 72900
4 year: 65610
5 year: 59049
6 year: 53144
7 year: 47829
8 year: 43046
9 year: 38742
10 year: 34867

Lokesh Kumar

Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.

4 thoughts on “Q23 Population of a town today is 100000. The population has increased steadily at the rate of 10% per year for last 10 years. Write a program to determine the population at the end of each year in the last decade.

  • August 22, 2020 at 9:20 pm
    Permalink

    i think the solution is wrong. The question is asking for something else. check it out.
    #include<stdio.h>
    #include<math.h>
    int main()
    {
    int x,i;
    x=10000/pow(1.1,10);
    for(i=10;i>=1;i–)
    {
    x=100000/pow(1.1,i);
    printf(“Population %d years ago: %d\n”,i,x);
    }
    return 0;
    }
    OUTPUT:
    Population 10 years ago: 38554
    Population 9 years ago: 42409
    Population 8 years ago: 46650
    Population 7 years ago: 51315
    Population 6 years ago: 56447
    Population 5 years ago: 62092
    Population 4 years ago: 68301
    Population 3 years ago: 75131
    Population 2 years ago: 82644
    Population 1 years ago: 90909

    Reply
    • May 30, 2021 at 3:31 am
      Permalink

      current year population is 100000, and in last ten years it increases every year at 10%.

      Reply
  • May 26, 2021 at 5:10 am
    Permalink

    sir why you use “(int)pop”

    Reply
    • August 24, 2022 at 6:02 pm
      Permalink

      Because pop has been declared as a float variable so after calculation the final value of pop we need to print it and to make it an integer value we have to add (int) before declaring the path of the printing value.

      Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.