FIFA-2022 Career Guide Free Tutorials Go to Your University Placement Preparation 
0 like 0 dislike
in GTU B.E. (CSE-I-Sem) Programming For Problem Solving Lab by Goeduhub's Expert (7.1k points)

Define a structure type struct personal that would contain person name, date of joining and salary using this structure to read this information of 5 people and print the same on screen.

1 Answer

0 like 0 dislike
by Goeduhub's Expert (7.1k points)
edited by
Best answer

In this program we are going to implement a structure Personal which contains name, date of joining and salary of employees.

To learn about structure and union from beginning Click Here.

Example :


//Declaration of structure Personal
struct Personal{

//Structure data members declaration
int salary,date;
char name[100];
//Using an array to hold information of 5 employees

void main()
int i;

//Values are being inserted by user
printf("\nEnter the following information of employees:");
printf("\nEmployee %d\nName:",i+1);
printf("\nJoining date(date and month as 2203):");

//Printing Employee information on output window
printf("\nEntered information is as follows:");
printf("\n|| S.No. ||      Name      ||    Salary    ||   Joining Date   |");
printf("\n|| %d     ||     %s          %d            %d     ",i+1,per[i].name,per[i].salary,per[i].date);

Output :

Output of above program showing structure operations

For More GTU C Programming Lab Experiments Click Here

Learn & Improve In-Demand Data Skills Online in this Summer With  These High Quality Courses[Recommended by GOEDUHUB]:-

Best Data Science Online Courses[Lists] on:-

Claim your 10 Days FREE Trial for Pluralsight.

Best Data Science Courses on Datacamp
Best Data Science Courses on Coursera
Best Data Science Courses on Udemy
Best Data Science Courses on Pluralsight
Best Data Science Courses & Microdegrees on Udacity
Best Artificial Intelligence[AI] Courses on Coursera
Best Machine Learning[ML] Courses on Coursera
Best Python Programming Courses on Coursera
Best Artificial Intelligence[AI] Courses on Udemy
Best Python Programming Courses on Udemy

Related questions

 Important Lists:

Important Lists, Exams & Cutoffs Exams after Graduation PSUs


About Us | Contact Us || Terms & Conditions | Privacy Policy ||  Youtube Channel || Telegram Channel © Social::   |  | 


Free Online Directory