Monday, 23 February 2015

Functoins and Structure IN C


/* Functoins and Structure         */
#include<stdio.h>
#include<conio.h>
struct Employee
{
float Basic;
float Hra;
float Da;
};

float SalCal(struct Employee);

main()
{
struct Employee E1;
clrscr();
printf("\n Enter Basic");
scanf("%f",&E1.Basic);
printf("\n Enter Hra :");
scanf("%f",&E1.Hra);
printf("\n Enter Da :");
scanf("%f",&E1.Da);
printf("\n Net Salary is :%f",SalCal(E1));
getch();
}
float SalCal(struct Employee E2)
{
return E2.Basic+E2.Hra+E2.Da;
}

No comments:

Post a Comment