# Golang How to calculate simple interest in Golang

It is a short tutorial about how to calculate simple interest using golang

## what is Simple Interest with formula

Simple interest is an interest applied to the principal amount applies to the rate of interest in a period for some time.

Normally, To calculate simple interest in mathematical terms, We have used the formula.

``    Simple Interest=P x N x R/100``
• P is the principal amount
• N is the Number of months
• R is the interest rate

In a program code,

• Take input of principal amount, interest, and Period
• Store all this in a variables
• Calculate using the above formula
• Finally print the result

Here is the golang program code to calculate simple interest

``````package main

import (
"fmt"
)

func main() {
var principal, interest, period, total float64;
fmt.Scanln(&principal)
fmt.Scanln(&interest)

fmt.Scanln(&period)

total= (principal* interest* period) / 100

fmt.Println("\nSimple Interest  Amount: ", total)
fmt.Println("\n Total  Amount: ", amount+total)

}``````

Output:

``````Please enter principal amount: 10000