Monday, 14 March 2016

Write A C++ Program For Store Employee Information And Display Using Structure

 #include<iostream.h>
 using namespace std;
       struct Employee
       {
              int Id;
              char Name[25];
              int Age;
              long Salary;
       };
//Ghanendra Ydav
       int main()
       {
              int i;
              Employee Emp[ 3 ];  

              for(i=0;i<3;i++)
              {

              cout << "\nEnter details of " << i+1 << " Employee";

                    cout << "\n\tEnter Employee Id : ";
                    cin >> Emp[i].Id;

                    cout << "\n\tEnter Employee Name : ";
                    cin >> Emp[i].Name;

                    cout << "\n\tEnter Employee Age : ";
                    cin >> Emp[i].Age;

                    cout << "\n\tEnter Employee Salary : ";
                    cin >> Emp[i].Salary;
              }

              cout << "\nDetails of Employees";
              for(i=0;i<3;i++)
              cout << "\n"<< Emp[i].Id <<"\t"<< Emp[i].Name <<"\t"
                       << Emp[i].Age <<"\t"<< Emp[i].Salary;


       }

output:-


4 comments:
Write comments
  1. good work bro..-biplab(M.Sc(Tech) Engg Physics, NITW)

    ReplyDelete
    Replies
    1. Welcome Bro Ghanendra Yadav(MCA CSE NITW)

      Delete
  2. Good work bro i am following your program, please could have the code for search, save, update,delete and exit of the employees. Thanks i will appreciate it.

    ReplyDelete

Recommended Posts × +