Sunteți pe pagina 1din 5

4/26/2018 C program to calculate Gross Salary of an employee - IncludeHelp

HOME ▼

c c++ java data structure python javascript css ajax pl/sql php puzzles c programs c++ programs java
programs

Custom Search

Home » C programs » C basic programs

C program to calculate Gross Salary of an employee

Get paid for doing what you love

Put Ads on your blog with


Adsense

LEARN MORE

This program will read Basic Salary of an employee, calculate other part of the salary on percent
basic and nally print the Gross Salary of the employee.

Here, we are reading basic salary of the employee, and calculating HRA, DA, PF and then Gross
salary of the employee.

C program for Gross Salary


/* c program to calculate salary of an employee with name */
#include <stdio.h>

int main()
{

char name[30];
float basic, hra, da, pf, gross;

printf("Enter name: ");

http://www.includehelp.com/c-programs/c-program-to-calculate-gross-salary-of-an-employee.aspx 1/5
4/26/2018 C program to calculate Gross Salary of an employee - IncludeHelp

gets(name);

printf("Enter Basic Salary: ");


scanf("%f",&basic);
printf("Enter HRA: ");
scanf("%f",&hra);
printf("Enter D.A.: ");
scanf("%f",&da);

/*pf automatic calculated 12%*/


pf= (basic*12)/100;

gross=basic+da+hra+pf;

printf("\nName: %s \nBASIC: %f \nHRA: %f \nDA: %f \nPF: %f \n***GROSS SALARY: %f

return 0;
}

Ads

Employee Salary Slip Example Program

Salary Structure C Program

Output

Enter name: Mike


Enter Basic Salary: 23000
Enter HRA: 9500
Enter D.A.: 9500

Name: Mike
BASIC: 23000.000000
HRA: 9500.000000
DA: 9500.000000
PF: 2760.000000
***GROSS SALARY: 44760.000000 ***

http://www.includehelp.com/c-programs/c-program-to-calculate-gross-salary-of-an-employee.aspx 2/5
4/26/2018 C program to calculate Gross Salary of an employee - IncludeHelp

You may also be interested in...

c/c++ tips and tricks...


C - Fastest way to copy two bytes integer number (short int) into byte bu er.
C - Pre-Increment is faster than post-increment.
C - How to create delay function according to program need?
Why should we use 'f' with oat literal in C?
Replacing a part of string in C.
Comparing xed number of characters of two strings in C language.
A safest way to check value using 'Equal To' (==) operator in C.
Check EVEN or ODD without using Modulus (%) Operator in C.
How can we use a single byte to store 8 values in C?
A funny trick to use C++ in C language program.
An amazing trick to print maximum value of an unsigned integer in C.

http://www.includehelp.com/c-programs/c-program-to-calculate-gross-salary-of-an-employee.aspx 3/5
4/26/2018 C program to calculate Gross Salary of an employee - IncludeHelp

most viewed pages...


C language solved programs
C++ language solved programs
C switch case programs
Basic Input, Output C programs
In x to post x conversion using stack in C
C programming Aptitude Que. and Ans.
Core java programs
Computer number systems & conversions
Java solved programs
C++ le handling programs
Recursion programs in C
More pages...

featured posts...
Di erence between %d and %i in C language.
Di erence between printf and sprintf in C language.
Di erence between Sentinel and Counter Controlled loop in C language.
Di erence between Entry Control and Exit Control loop in C language.
Di erence between Unary and Binary Operators in C language.
Di erence between = (Assignment) and == (Equal to) Operators in C language.
Di erence between & (Address Of) and && (Logical AND) Operators in C language.
Di erence between Local and Global variables in C.

Was this page helpful? YES NO

http://www.includehelp.com/c-programs/c-program-to-calculate-gross-salary-of-an-employee.aspx 4/5
4/26/2018 C program to calculate Gross Salary of an employee - IncludeHelp

Are you a blogger? Join our Blogging forum.

Comments and Discussions

0 Comments www.includehelp.com 
1 Login

Sort by Newest
 Recommend ⤤ Share

Start the discussion…

LOG IN WITH
OR SIGN UP WITH DISQUS ?

Name

Be the first to comment.

✉ Subscribe d Add Disqus to your siteAdd DisqusAdd 🔒 Privacy

# About # Advertise # Contact # Feedback


# Internship # Certi cates # Jobs
# Personal blogs # Guest posting # Subscribe

Keywords (like Linux, Java, Oracle etc) used in this website are the trademarks of their respective owners/company. This website is
not a liated to any company. The tutorials are designed by includehelp Team with the help of well known books and other online
resources. These Tutorials are free for all, for learning purposes only. Enjoy learning:)
Copyright © 2015 - 2017. All Rights Reserved.

http://www.includehelp.com/c-programs/c-program-to-calculate-gross-salary-of-an-employee.aspx 5/5

S-ar putea să vă placă și