FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 55   



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)

using System;

class MainClass {
  public static void Main (string[] args) {
    Console.WriteLine("Enter bill amount:");
    int bill = Convert.ToInt32(Console.ReadLine());
    Console.WriteLine("Enter discount percentage:");
    int discount = Convert.ToInt32(Console.ReadLine());
    int afterDiscount = bill - (bill * discount / 100);
    Console.WriteLine("After discount your bill is: " + afterDiscount);

  }
}

Output:

Enter bill amount:
 5000
Enter discount percentage:
 10
After discount your bill is: 4500



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News