समस्या
ब्याज के साथ कुछ वर्षों के बाद बढ़ी हुई जमा राशि की गणना करने के लिए एक सी प्रोग्राम लिखें
समाधान
ब्याज की गणना का सूत्र है -
M=((r/100) * t); A=P*exp(M);
जहां r=ब्याज दर
टी =नहीं। वर्षों के
P=जमा की जाने वाली राशि
एम=अस्थायी चर
A=ब्याज के बाद अंतिम राशि
एल्गोरिदम
START Step 1: declare double variables Step 2: read amount to be deposited Step 3: read rate of interest Step 4: read years you want to deposit Step 5: Calculate final amount with interest I. M=((r/100) * t); II. A=P*exp(M); Step 6: Print final amount STOP
उदाहरण
#include<stdio.h>
#include<math.h>
#include<ctype.h>
int main(){
double P,r,t,A,M;
printf("amount to be deposit in the bank: ");
scanf("%lf",&P);
printf("\n enter the rate of interest:");
scanf("%lf",&r);
printf("\n How many years you want to deposit:");
scanf("%lf",&t);
M=((r/100) * t);
A=P*exp(M);
printf("\n amount after %0.1lf years with interest is:%0.2lf",t,A);
return 0;
} आउटपुट
amount to be deposit in the bank: 50000 enter the rate of interest:6.5 How many years you want to deposit:5 amount after 5.0 years with interest is:69201.53