C Source code help (2) - TechRepublic
General discussion
January 28, 2010 at 11:38 PM
vicpri

C Source code help (2)

by vicpri . Updated 16 years, 5 months ago

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 discussion is locked

All Comments