I need a Net Present Value Calculator in C using arrays and forloop.
Here is info about what it is:http://financeformulas.net/Net_Present_Value.html
I myself tried to write the code, but am unable to get thecorrect answer.
Here is my code:
//
printf(“Enter Initial Investment:n”);
scanf(“%d”,&z);
printf(“Intrerest Raten”);
scanf(“%f”,&w);
printf(“Period of Cash flow in Yearsn”);
scanf(“%d”,&x);
printf(“Cash Flowsn”);
for(int m=0;m scanf(“%d”,&array[m]);
s=0;
for(int m=0;m {
s=s+(array[m]/pow(w,(m+(1/100))));
}
result=s-z;
//
If my code is completely wrong, then please provide me with thecorrect one, thanks
Expert Answer
An answer will be send to you shortly. . . . .