Well, the problem is that you have 5 printf statements on each cycle of the loop. If you only want it to print once per loop cycle, why do you have five?
Thanks, the reply. If one print only, i got the result as below. The value start 2013 till 2017 is same = 4400. I need help how to integrate the program which the output value is different with every year starting from 2013. Any suggestion how to make it?
That's because at the start of each iteration of the loop, you're resetting the value of growth to the same value. You need to change the logic of your algorithm so that each iteration of the loop increases the value of growth from its previous value, rather than resetting it to the same value as it was on the previous iteration.
I can help, but I'm not going to write the code for you. Thinking about the logic of algorithms is a vitally important part of programming, and it's a skill all programmers need to practise.
Can you see where in the code you're setting the value of growth?
Do you understand why this value is the same on every iteration of your loop?
Can you think how you might change the way you calculate the value of growth, so that it gives you the right value on each iteration of the loop?
I do many times try to created the right logic of algorithms, but an impasse. I don't know how to used the result to put back in the formula. I just need simple code from you to show me how the logic of algorithms can give the result according to the proper output. Or just show the other way. That why, i need somebody can guide me with the a little touch which can correct my program.