C# program to calculate salary hike

Views: 18   

Following program shows you how to calculate salary hike.
In this program we get salary per month and hike from user and calculate new salary with hike using following formula
Salary hike = oldSalaryPerMonth + (oldSalaryPerMonth X hike/100)

using System;

class MainClass {
  public static void Main (string[] args) {
    Console.WriteLine("Enter your old salary per month:");
    int oldSalaryPerMonth = Convert.ToInt32(Console.ReadLine());
    Console.WriteLine("Enter your hike percentage:");
    int hike = Convert.ToInt32(Console.ReadLine());
    int presentSalaryPerMonth = oldSalaryPerMonth + (oldSalaryPerMonth * hike/100);
    Console.WriteLine("After hike your present salary per month is: " + presentSalaryPerMonth );

  }
}

Output:

Enter your old salary per month:
 60000
Enter your hike percentage:
 20
After hike your present salary per month is: 72000
On By