Thursday, 26 May 2016
Q: Write a program that declares a structure to store the code number, salary and grade of an employee. the program defines two structure variables, inputs records of two employees and the displays the record of the employee with more salary.
Program:
#include<iostream.h>
#include<conio.h>
struct employee
{
int code_num;
int salary;
int grade;
};
void main()
{
employee e1, e2;
cout<<" Enter the code number, salary and grade of the first employee:";
cin>>e1.code_num<<e1.salary<<e1.grade;
cout<<"Enter the code number, salary and grade of the second employee:";
cin>>e2.code_num<<e2.salary<<e2.grade;
cout<<" The Employee with more salary is: "<<endl;
if(e1.salary>e2.salary)
{
cout<<" Code Number "<<e1.code_num<<endl;
cout<<" Salary "<<e1.salary<<endl;
cout<< " Grade "<<e1.grade;
}
else
{
cout<< " Code Number "<<e2.code_num<<endl;
cout<<" Salary "<<e2.salary<<endl;
cout<<" Grade "<<E2.grade;
}
getche();
}
Subscribe to:
Post Comments (Atom)
it862 tenishokamexico,hokaschuhe,hokaschuhe,hokachaussure,hokasuisse,zapatillashoka,hokashoescolombia,scarpehoka,hokaschoenen vf243
ReplyDelete