Thanks for replying, i want to add 3% of 17810 to itself (that is 17810). And repeat this upto 8th time.
Basically i want (say x)
x1=17810+0.03*17810
and then
x2=x1+0.03*x1
and repeat it till x8
Please can you explain in detail as i am new to c language.
You want to use either a for loop or a while loop that iterates 8 times. The for loop would probably be best suited for your problem. As for the math.
Setting a variable equal to the initial amount of 17810 and then adding 3% of that to itself would be a good way to do it.
1 2 3 4 5 6
//something like this.
double amount = 17810;
//math would like this.
amount = amount + (amount * .03);
//or
amount += amount * .03;