Posted by MindBreaker at 2:36 PM
Read our previous post
Create a
structure to hold ENo, EName, Designation and salary of an employee. Take input
in this structure variable and
display
output.
Source Code
#include
<iostream>
#include
<string>
using
namespace std;
struct
Employee
{
int Eno;
char Designation[15];
long salary;
};
void main()
{
Employee Emp;
cout << "Enter Employee number:
";
cin >> Emp.Eno;
cout << endl;
cout << "Enter Employee's
designation: ";
cin >>Emp.Designation;
cout << endl;
cout << "Enter Employee's salary:
" ;
cin >> Emp.salary;
cout << endl;
cout << endl;
cout << "Employee Number"
<< "\t" << " Employee Designation" <<
"\t" << " Employee Salary" << endl; cout << endl;
cout << Emp.Eno <<
"\t\t\t" << Emp.Designation << "\t\t\t"
<< Emp.salary << endl; cout << endl;
}
Output
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.