Suppose there is a fund that always pays fixed interest rates.

I made a program to calculate monthly savings if we use this fund to save a targeted amount with fixed savings.

#include<stdio.h>
int main(){
	int x=0,time=0,ta=0;
	double m=0,r=0,ir=0;
	printf("Number of saving periods :");
	scanf("%d",&time);
	printf("\nInterest rate :");
	scanf("%lf",&ir);
	printf("\nTarget amount :");
	scanf("%d",&ta);
	for(int i=0;i!=time;i++){
		double m=1;
		for(int r=time-i;r!=time;r++){
			m=m*ir;
		}
		r+=m;
	}
	r=ta/r;
	printf("%lf\n",r);
}

Let compile and run

Leave a Reply

Your email address will not be published. Required fields are marked *