TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

Program to find the simple interest

Program to find the simple interest on fibonacci, factorial, prime, armstrong, swap, reverse, search, sort, stack, queue, array, linkedlist, tree, graph etc.

<< Back to PROGRAM

Program to find the simple interest

Explanation

Simple Interest is the convenient method used in banking and economic sectors to calculate the interest charges on loans.It gets estimated day to day with the help of some mathematical terms.

Formula

Simple Interest = (P × R × T)/100
where P = Principal Amount, R = Rate per Annum, T = Time (years)

Algorithm

  1. Define Principal, Interest and Time of loans.
  2. Apply in the formula.
  3. Print the Simple Interest.

Complexity

O(1)


Solution

Python

P= 5000 #Principal Amount
R=15 #Rate 
T=1 #Time
SI  = (P*R*T)/100; # Simple Interest calculation
print("Simple Interest is :");
print(SI);  #prints Simple Interest

Output:

 Simple Interest is:  750.0

C

#include<stdio.h>
int main() 
    { 
        float P , R , T , SI ;
       P =34000; R =30;  T = 5;
        SI  = (P*R*T)/100; 
        printf("\n\n Simple Interest is : %f", SI);
        return (0);
    }

Output:

Simple Interest is:  51000.000

JAVA

public class Main
 {
   public static void main (String args[])
    {	float p, r,  t,  si; // principal amount, rate, time and simple interest respectively
              p = 13000;  r = 12; t = 2;
               si  = (p*r*t)/100; 
              System.out.println("Simple Interest is: " +si);
	}}

Output:

Simple Interest is:  3120.0

C#

using System;
class main
{   static void Main() 
    { int P;
      double R, T,  SI;
      P = 12000;
      R = 5;
      T =0.5;
      SI  = (P*R*T)/100;
     Console.WriteLine("Simple Interest is: "+SI);
    }}

Output:

Simple Interest is:  300.00

PHP

<?php
       $p = 2000;
       $r = 10;
       $t = 1;
       $si =   ($p*$r*$t)/(100);
       echo("Simple Interest is: ");
       echo($si);
?>

Output:

Simple Interest is: 200

Next Topic#




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf