SlideShare a Scribd company logo
1 of 1
Download to read offline
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
#include
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: " <

More Related Content

More from fathimalinks

This is question about excel cuers wish to answer shortly how to use.pdf
This is question about excel cuers wish to answer shortly how to use.pdfThis is question about excel cuers wish to answer shortly how to use.pdf
This is question about excel cuers wish to answer shortly how to use.pdf
fathimalinks
 
There is a requirement to design a system to sense the presence of gl.pdf
There is a requirement to design a system to sense the presence of gl.pdfThere is a requirement to design a system to sense the presence of gl.pdf
There is a requirement to design a system to sense the presence of gl.pdf
fathimalinks
 
Research and explain the deviant actions of the Los Angeles Police D.pdf
Research and explain the deviant actions of the Los Angeles Police D.pdfResearch and explain the deviant actions of the Los Angeles Police D.pdf
Research and explain the deviant actions of the Los Angeles Police D.pdf
fathimalinks
 
Q1. Print all the odd numbers from 1 to a user specifiable upper lim.pdf
Q1. Print all the odd numbers from 1 to a user specifiable upper lim.pdfQ1. Print all the odd numbers from 1 to a user specifiable upper lim.pdf
Q1. Print all the odd numbers from 1 to a user specifiable upper lim.pdf
fathimalinks
 
Please revise the answer bellow.Q1. What historically have been Ap.pdf
Please revise the answer bellow.Q1. What historically have been Ap.pdfPlease revise the answer bellow.Q1. What historically have been Ap.pdf
Please revise the answer bellow.Q1. What historically have been Ap.pdf
fathimalinks
 
Negligence Curtis R. Wilhelm owned beehives and kept the hives on pr.pdf
Negligence Curtis R. Wilhelm owned beehives and kept the hives on pr.pdfNegligence Curtis R. Wilhelm owned beehives and kept the hives on pr.pdf
Negligence Curtis R. Wilhelm owned beehives and kept the hives on pr.pdf
fathimalinks
 
If every cell and tissue in the body can potentially see or be ex.pdf
If every cell and tissue in the body can potentially see or be ex.pdfIf every cell and tissue in the body can potentially see or be ex.pdf
If every cell and tissue in the body can potentially see or be ex.pdf
fathimalinks
 
Help if you can Genetics question. thanks beforehand! You continue y.pdf
Help if you can Genetics question. thanks beforehand! You continue y.pdfHelp if you can Genetics question. thanks beforehand! You continue y.pdf
Help if you can Genetics question. thanks beforehand! You continue y.pdf
fathimalinks
 
From the water what is the zonation of the typical mangrove ecosyst.pdf
From the water what is the zonation of the typical mangrove ecosyst.pdfFrom the water what is the zonation of the typical mangrove ecosyst.pdf
From the water what is the zonation of the typical mangrove ecosyst.pdf
fathimalinks
 

More from fathimalinks (20)

This is question about excel cuers wish to answer shortly how to use.pdf
This is question about excel cuers wish to answer shortly how to use.pdfThis is question about excel cuers wish to answer shortly how to use.pdf
This is question about excel cuers wish to answer shortly how to use.pdf
 
There is a requirement to design a system to sense the presence of gl.pdf
There is a requirement to design a system to sense the presence of gl.pdfThere is a requirement to design a system to sense the presence of gl.pdf
There is a requirement to design a system to sense the presence of gl.pdf
 
The investments of Charger Inc. include a single investment 11,010 .pdf
The investments of Charger Inc. include a single investment 11,010 .pdfThe investments of Charger Inc. include a single investment 11,010 .pdf
The investments of Charger Inc. include a single investment 11,010 .pdf
 
RNA polymerasebinds to DNA after the double strands have been unwoun.pdf
RNA polymerasebinds to DNA after the double strands have been unwoun.pdfRNA polymerasebinds to DNA after the double strands have been unwoun.pdf
RNA polymerasebinds to DNA after the double strands have been unwoun.pdf
 
Research and explain the deviant actions of the Los Angeles Police D.pdf
Research and explain the deviant actions of the Los Angeles Police D.pdfResearch and explain the deviant actions of the Los Angeles Police D.pdf
Research and explain the deviant actions of the Los Angeles Police D.pdf
 
Question 1 10 points Save A TALIA Contribute NINA Co Contribute TALIA.pdf
Question 1 10 points Save A TALIA Contribute NINA Co Contribute TALIA.pdfQuestion 1 10 points Save A TALIA Contribute NINA Co Contribute TALIA.pdf
Question 1 10 points Save A TALIA Contribute NINA Co Contribute TALIA.pdf
 
Q1. Print all the odd numbers from 1 to a user specifiable upper lim.pdf
Q1. Print all the odd numbers from 1 to a user specifiable upper lim.pdfQ1. Print all the odd numbers from 1 to a user specifiable upper lim.pdf
Q1. Print all the odd numbers from 1 to a user specifiable upper lim.pdf
 
Please revise the answer bellow.Q1. What historically have been Ap.pdf
Please revise the answer bellow.Q1. What historically have been Ap.pdfPlease revise the answer bellow.Q1. What historically have been Ap.pdf
Please revise the answer bellow.Q1. What historically have been Ap.pdf
 
Negligence Curtis R. Wilhelm owned beehives and kept the hives on pr.pdf
Negligence Curtis R. Wilhelm owned beehives and kept the hives on pr.pdfNegligence Curtis R. Wilhelm owned beehives and kept the hives on pr.pdf
Negligence Curtis R. Wilhelm owned beehives and kept the hives on pr.pdf
 
List and explain at least three popular sixteenth century dance type.pdf
List and explain at least three popular sixteenth century dance type.pdfList and explain at least three popular sixteenth century dance type.pdf
List and explain at least three popular sixteenth century dance type.pdf
 
Introduction to Database Management SystemConsider the following .pdf
Introduction to Database Management SystemConsider the following .pdfIntroduction to Database Management SystemConsider the following .pdf
Introduction to Database Management SystemConsider the following .pdf
 
In female mammals, one of the X chromosomes in each cell is condensed.pdf
In female mammals, one of the X chromosomes in each cell is condensed.pdfIn female mammals, one of the X chromosomes in each cell is condensed.pdf
In female mammals, one of the X chromosomes in each cell is condensed.pdf
 
imonene, a compound synthesized by plants, is sequestered by butterf.pdf
imonene, a compound synthesized by plants, is sequestered by butterf.pdfimonene, a compound synthesized by plants, is sequestered by butterf.pdf
imonene, a compound synthesized by plants, is sequestered by butterf.pdf
 
If every cell and tissue in the body can potentially see or be ex.pdf
If every cell and tissue in the body can potentially see or be ex.pdfIf every cell and tissue in the body can potentially see or be ex.pdf
If every cell and tissue in the body can potentially see or be ex.pdf
 
How would you write think funcion in C programWrite a function .pdf
How would you write think funcion in C programWrite a function  .pdfHow would you write think funcion in C programWrite a function  .pdf
How would you write think funcion in C programWrite a function .pdf
 
Gutenbergs Revolution has been compared to the Internet Revolution.pdf
Gutenbergs Revolution has been compared to the Internet Revolution.pdfGutenbergs Revolution has been compared to the Internet Revolution.pdf
Gutenbergs Revolution has been compared to the Internet Revolution.pdf
 
Help if you can Genetics question. thanks beforehand! You continue y.pdf
Help if you can Genetics question. thanks beforehand! You continue y.pdfHelp if you can Genetics question. thanks beforehand! You continue y.pdf
Help if you can Genetics question. thanks beforehand! You continue y.pdf
 
From the water what is the zonation of the typical mangrove ecosyst.pdf
From the water what is the zonation of the typical mangrove ecosyst.pdfFrom the water what is the zonation of the typical mangrove ecosyst.pdf
From the water what is the zonation of the typical mangrove ecosyst.pdf
 
find the ordinal position of 623SolutionA place or rank, like .pdf
find the ordinal position of 623SolutionA place or rank, like .pdffind the ordinal position of 623SolutionA place or rank, like .pdf
find the ordinal position of 623SolutionA place or rank, like .pdf
 
Each of the following diagrams represents cells from an animal with .pdf
Each of the following diagrams represents cells from an animal with .pdfEach of the following diagrams represents cells from an animal with .pdf
Each of the following diagrams represents cells from an animal with .pdf
 

Recently uploaded

Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Recently uploaded (20)

Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 

Write a program in C++ that declares a structure to store the code n.pdf

  • 1. 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 #include 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: " <