TASK:
Zain’s basic salary is input through the keyboard. His dearness allowance is 25% of basic salary, and house rent allowance is 40% of basic salary. Write a program to calculate and display the total allowances and his gross salary.
OUTPUT:
Here the task asks for a Gross salary which is the sum of allowance and the basic salary below is the code which tells how easily the task can be performed and the above output could be achieved.
CODE:
#include<stdio.h>
int main(){
float allowance,gross_salary,basic_salary; //initializing variables;
printf("Enter your salary\n");
scanf("%f",&basic_salary); //Taking value of basic salary from user;
allowance=(basic_salary*0.25)+(basic_salary*0.40);
//calculating allownace by the given data (25%=25/100=0.25) and (40%=40/100=0.40)
gross_salary=allowance+basic_salary;
printf("Gross salary = %0.2f with allowance of %0.2f",gross_salary,allowance);
getchar();
return 0;
}
Great
ReplyDeleteThanks For uploading You are great and you always post great knowledge And ones again thank you.
ReplyDeleteThanks for uploading a great information
ReplyDeleteNice work bro
ReplyDeleteAmazing
ReplyDeleteUnpredictable
ReplyDelete