Wednesday, 20 August 2014

C Program for the following Statement



Statement:

                              Harish'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 gross salary.


Program:

#include<stdio.h>
#include<conio.h>
void main( )
{
int s,da,hra,gs;
clrscr( ); // Clear the screen contents
printf("\nEnter the Basic Salary:");
scanf("%d",&s);
da=(s*40)/100;
hra=(s*20)/100;
gs=s+da+hra;
printf("\nDearness Allowance %d",da);
printf("\nHouse rent allowance %d",hra);
printf("\nGross Salary is %d",gs);
}



0 comments:

Post a Comment