Monday, 24 August 2015

Write a C Program that accept basic, HRA, and convergence from the user and calculate total salary

#include<stdio.h>
#include<conio.h>

int main()
{
            float basic,HRA,cnvg,totsal;
            clrscr();

            printf("\n Enter basic salary : ");
            scanf("%f",&basic);

            printf("\n Enter HRA : ");
            scanf("%f",&HRA);

            printf("\n Enter convergence : ");
            scanf("%f",&cnvg);

            HRA=(basic*HRA)/100;
            cnvg=(basic*cnvg)/100;
            totsal=basic+HRA+cnvg;

            printf("\n\n Total salary is %.2f",totsal);

            getch();

            return 0;
}


2 comments: