by Dinesh Thakur Category: Array Pointer and Union

 

#include<iostream.h>

#include<conio.h>
struct employee
{
       char name[20];
       float bp;
       float da;
       float hra;
       float netpay;
}emp;
              void main()
           {
                employee npay(employee emp);
                employee y;
                clrscr();
                cout<<"\n Enter the Name, Basic Pay, Da, Hra :";
                cin>>emp.name>>emp.bp>>emp.da>>emp.hra;
                y= npay(emp);
                cout<<"\nNet pay is : "<<y.netpay;
                getch( );
          }
                 employee npay(employee z)
             {
                 z.netpay =z.bp + z. da +z.hra;
                 return(z);
             }

Compute Net Pay Of An Employee



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles