logo image

C# program to calculate salary hike


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 );



Enter your old salary per month:
Enter your hike percentage:
After hike your present salary per month is: 72000