logo image

C Language program to calculate salary hike

Views: 49

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)

#include <stdio.h>

int main(void) {
	int oldSalaryPerMonth;
	int hike;

	printf("Enter your old salary per month:");
	scanf("%d", &oldSalaryPerMonth);

	printf("Enter your hike percentage:");
	scanf("%d", &hike);

	int presentSalaryPerMonth =
		oldSalaryPerMonth + (oldSalaryPerMonth * hike / 100);

		"After hike your present salary per month is: %d",


Enter your old salary per month: 30000
Enter your hike percentage: 20
After hike your present salary per month is: 36000