13 : Write a C program that accepts an employee's ID, total worked hours of a month and the amount he received per hour. Print the employee's ID and salary (with two decimal places) of a particular month.

/*
 Write a C program that accepts an employee's ID, total worked hours of a month and the amount he received per hour. Print the employee's ID and salary (with two decimal places) of a particular month. 
Test Data :
Input the Employees ID(Max. 10 chars): 0342
Input the working hrs: 8
Salary amount/hr: 15000
Expected Output:
Employees ID = 0342
Salary = U$ 120000.00
*/
#include<stdio.h>
main(void)
{
char Input_the_Employees_ID[10];
printf("Input the Employees ID(Max. 10 chars):");
scanf("%sAD",&Input_the_Employees_ID);
int Input_the_working_hrs;
printf("Input the working hrs:");
scanf("%d",&Input_the_working_hrs);
int salary_amount_per_hrs;
printf("Salary amount/hr : ");
scanf("%d",&salary_amount_per_hrs);
printf("Employees ID = %s\n",Input_the_Employees_ID);
float salary=salary_amount_per_hrs*Input_the_working_hrs;
printf("Salary = U$ %.2f",salary);
}

Comments