Go Program to calculate Simple Interest

Write a Go Program to calculate Simple Interest. This golang program allows the user to enter the total principal amount, rate of interest, and the number of years and then find the Simple Interest. The formula to find simple interest is

Simple Interest = (principal amount * rate of interest * years) / 100

package main

import "fmt"

func main() {

    var amount, InterestRate, time, simpleI float64

    fmt.Print("Enter the Principal or Total Amount = ")
    fmt.Scanln(&amount)

    fmt.Print("Enter the rate of Interest = ")
    fmt.Scanln(&InterestRate)

    fmt.Print("Enter the Total number of Years = ")
    fmt.Scanln(&time)

    simpleI = (amount * InterestRate * time) / 100

    fmt.Println("\nThe Simple Interest  = ", simpleI)
}
Go Program to calculate Simple Interest 1

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.