Ramesh's basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary. - Code With Friends

Breaking

Home Top Ad

Search Your Questions

Sunday, February 17, 2019

Ramesh's basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.

#include<stdio.h>
int main()
{
    int salary;
    float basic,rate,sum;

    printf("Enter your basic salary");
    scanf("%d",&salary);

    basic=(salary/40)*100;
    rate=(salary/20)*100;
    sum=basic+rate+salary;
    printf("Your total salary after adding dearness allowance and house rent is  %f\n",sum);

}





No comments:

Post a Comment