Software

Our forums are currently in maintenance mode and the ability to post is disabled. We will be back up and running as soon as possible. Thanks for your patience!

General discussion

Locked

C Source code help (2)

By Vicpri ·
This is another program, i m getting error for this program....can u plsz rectify the error...
.
.
.
http://pastebin.com/m4699d5fc
or
/*Emplyoee Details using structures*/
#include
#include
struct employee
{
int eno;
char ename[25];
float basic,hra,da,ta,pf,it,gs,ns;
}
main()
{
struct employee emp[10];
int i,n;
float f,b;
clrscr();
printf("Enter number of employee\t");
scanf("%d",&n);
printf("\nEnter Employee data");
for(i=0;i<=n;i++)
{
printf("\nEnter Employee code\t");
scanf("%d",&emp.eno);
printf("\nEnter Employee Name\t");
scanf("%s",&emp.ename);
printf("\nEnter Basic Salary\t");
scanf("%f",&b);
emp.basic=b;
emp.hra=emp.basic*20/100;
emp.da=emp.basic*15/100;
emp.pf=emp.basic*12/100;
emp.it=emp.basic*5/100;
emp.gs=emp.basic+emp.hra+emp.da+emp.ta+emp.pf+emp.it;
emp.ns=emp.gs(emp.pf+emp.it);
printf("\nThe Employee Details are");
for(i=0;i<=n;i++)
{
printf("\nEmployee Code=%d",emp.eno);
printf("\nEmployee Name=%s",emp.ename);
printf("\nBasic sal=%f",emp.basic);
printf("\nHra=%f",emp.hra);
printf("\nDa=%f",emp.da);
printf("\nTa=%f",emp.ta);
printf("\npf=%f",emp.pf);
printf("\nit=%f",emp.it);
printf("\nGross sal=%f",emp.gs);
printf("\nnetsal=%f",emp.ns);
}
getch();
}
}

(error:

for 2nd program
..
..
emp.ns=emp.gs(emp.pf+emp.it);
..
..
for the above line it is showing "call of non-function in function main"
)

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Related Discussions

Related Forums