কম্পিউটার

C ভাষায় সূত্র ব্যবহার করে সুদের পরিমাণ গণনা করুন


সমস্যা

সুদের সাথে কয়েক বছর পরে বর্ধিত জমাকৃত পরিমাণ গণনা করার জন্য একটি সি প্রোগ্রাম লিখুন

সমাধান

সুদ গণনার সূত্র হল −

M=((r/100) * t);
A=P*exp(M);

যেখানে r=সুদের হার

t=না। বছরের

P=আমানত জমা করতে হবে

M=অস্থায়ী পরিবর্তনশীল

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

  1. সি ভাষা ব্যবহার করে একটি সারিতে একটি উপাদান মুছে ফেলা ব্যাখ্যা করুন

  2. সি ভাষা ব্যবহার করে সন্নিবেশ বাছাই ব্যাখ্যা করুন।

  3. সি ভাষা ব্যবহার করে স্ট্রিংকে সংখ্যা এবং সংখ্যাকে স্ট্রিংয়ে রূপান্তর করা হচ্ছে

  4. সি ভাষায় পয়েন্টার ব্যবহার করে গাণিতিক ক্রিয়াকলাপ ব্যাখ্যা কর?