Problem Description
Help Vijay to calculate his first salary that he got from the SRM University, he was confused with an salary credited in his savings account. He asked his friend Rohit to identify how salary pay got calculated. Rohit gave him the following details and the format of salary.
His basic pay (to be entered by user) and
Rohit developed a software to calculate the salary pay roll with format given as below
HRA=80% of the basic pay,
dA=40% of basic pay
bonus = 25 % of hra
Input and Output Format:
Refer sample input and output for formatting specification.
All float values are displayed correct to 2 decimal places.
All text in bold corresponds to input and the rest corresponds to outputTest Case 1
Input (stdin)50000
Expected OutputTotal Salary=120000.00
Test Case 2
Input (stdin)4000
Expected OutputTotal Salary=9600.00
Program
#include <stdio.h> int main() {int a,hra,da,b; scanf("%d",&a); hra=0.8*a; da=0.4*a; b=0.25*hra; printf("Total Salary=%.2f",1.0*(a+b+hra+da)); return 0; }
No comments:
Post a Comment
Note: only a member of this blog may post a comment.