Programa para encontrar el interés simple

¿Qué es el ‘Interés Simple’?  
El interés simple es un método rápido para calcular el cargo de interés de un préstamo. El interés simple se determina multiplicando la tasa de interés diaria por el principal por el número de días que transcurren entre los pagos. 
Fórmula de interés simple:
 

La fórmula de interés simple viene dada por: 
Interés simple = (P x T x R)/100 
Donde, 
P es la cantidad principal 
T es el tiempo y 
R es la tasa

Ejemplos: 
 

EXAMPLE1:
Input : P = 10000
        R = 5
        T = 5
Output :2500
We need to find simple interest on 
Rs. 10,000 at the rate of 5% for 5 
units of time.

EXAMPLE2:
Input : P = 3000
        R = 7
        T = 1
Output :210

La fórmula para calcular el interés simple es: interés_simple = (P * T * R) / 100 donde P es el monto principal, T es el tiempo y R es la tasa de interés. 
 

C++

// CPP program to find simple interest for
// given principal amount, time and rate of
// interest.
#include<iostream>
using namespace std;
int main()
{
    // We can change values here for
    // different inputs
    float P = 1, R = 1, T = 1;
 
    /* Calculate simple interest */
    float SI = (P * T * R) / 100;
 
    /* Print the resultant value of SI */
    cout << "Simple Interest = " << SI;
 
    return 0;
}

C

#include <stdio.h>
 
int main()
{
    // We can change values here for
    // different inputs
    float P = 1, R = 1, T = 1;
 
    /* Calculate simple interest */
    float SI = (P * T * R) / 100;
 
    printf("Simple Interest = %f\n", SI);
 
    return 0;
}
 
// This code is contributed by agarwalsajal19.

Java

// A Simple JAVA program to compute
// simple interest for given principal
// amount, time and rate of interest.
import java.io.*;
 
class GFG
{
    public static void main(String args[])
    {  
        // We can change values here for
        // different inputs
        float P = 1, R = 1, T = 1;
         
        /* Calculate simple interest */
        float SI = (P * T * R) / 100;
        System.out.println("Simple interest = "+ SI);
    }
}
 
// This code is contributed by Anant Agarwal.

Python3

# Python3 program to find simple interest
# for given principal amount, time and
# rate of interest.
 
# We can change values here for
# different inputs
P = 1
R = 1
T = 1
 
# Calculates simple interest
SI = (P * R * T) / 100
 
# Print the resultant value of SI
print("simple interest is", SI)
  
# This code is contributed by Azkia Anam.

C#

// A Simple C# program to compute
// simple interest for given principal
// amount, time and rate of interest.
using System;
 
class GFG {
     
    // Driver Code
    public static void Main()
    {
         
        // We can change values here for
        // different inputs
        float P = 1, R = 1, T = 1;
         
        // Calculate simple interest
        float SI = (P * T * R) / 100;
        Console.Write("Simple interest = "+ SI);
    }
}
 
// This code is contributed by Nitin Mittal.

PHP

<?php
// PHP program to find simple interest
// for given principal amount, time
// and rate of interest.
 
// We can change values here for
// different inputs
$P = 1;
$R = 1;
$T = 1;
 
/* Calculate simple interest */
$SI = ($P * $T * $R) / 100;
 
/* Print the resultant value of SI */
echo "Simple Interest = ". $SI;
 
// This code is contributed by Sam007
?>

Javascript

<script>
 
// JavaScript program to find simple interest for
// given principal amount, time and rate of
// interest.
 
 
    // We can change values here for
    // different inputs
    let P = 1, R = 1, T = 1;
 
    /* Calculate simple interest */
    let SI = (P * T * R) / 100;
 
    /* Print the resultant value of SI */
    document.write("Simple Interest = " + SI);
 
 
// This code is contributed by Surbhi Tyagi.
 
</script>

Producción : 

Simple Interest : 0.01

Complejidad temporal : O(1) 
Espacio auxiliar : O(1)

Este artículo es una contribución de Anurag Rawat . Si te gusta GeeksforGeeks y te gustaría contribuir, también puedes escribir un artículo usando write.geeksforgeeks.org o enviar tu artículo por correo a review-team@geeksforgeeks.org. Vea su artículo que aparece en la página principal de GeeksforGeeks y ayude a otros Geeks.
Escriba comentarios si encuentra algo incorrecto o si desea compartir más información sobre el tema tratado anteriormente.
 

Publicación traducida automáticamente

Artículo escrito por GeeksforGeeks-1 y traducido por Barcelona Geeks. The original can be accessed here. Licence: CCBY-SA

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *