Go language program to calculate discount
Following program shows you how to calculate discount.
In this program we get bill amount and discount from user and shows after discount amount using following formula
Discount = bill - (bill * discount / 100)
package main
import "fmt"
func main() {
var bill int
var discount int
var afterDiscount int
fmt.Println("Enter bill amount:")
fmt.Scanf("%d", &bill)
fmt.Println("Enter discount percentage:")
fmt.Scanf("%d", &discount)
afterDiscount = bill - (bill * discount / 100)
fmt.Println("After discount your bill is: " , afterDiscount)
}
Output:
Enter bill amount:
50000
Enter discount percentage:
30
After discount your bill is: 35000