Write a program in C that declares a structure to store the

Write a program in C++ that declares a structure to store the code number, salary and grade of an employee. The program defines two structures variables, inputs records of two employees and then displays the record of the employees.

Solution

#include<iostream>

#include<cstdio>

using namespace std;

struct employee

{

int codenumber[7];

char grade[14];

float salary;

};

int main(void)

{

struct employee ;

cout<<\'\ .......................................: \" ;

cout<<\"\ enter the employee code number: \" ;

gets(employee.codenumber);

cout<<\"\ enter the employee grade: \" ;

gets(employee.grade);

cout<<\"\ enter the employee salary: \" ;

gets(employee.salary);

return (employee);

}

int list_function(employee list)

{

cout<<\"\ employee codenumber: \" <<list.codenumber;

cout<<\"\ employee grade: \"<<list.grade;

cout<<\"\ employee salary: \"<<list.salary;

return 0;

}

Write a program in C++ that declares a structure to store the code number, salary and grade of an employee. The program defines two structures variables, inputs

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site