logo

UrgentHomeWork

img+1-617-874-1011 (US)
img+44-117-230-1145 (UK)
ws+61-7-5641-0117 (AU)
help@urgenthomework.com
Live chat

Available 24 x 7 Assignment Help

With Tutoring

Structures and Pointers

#include <stdio.h>
#include <conio.h>
int main()
{
{`//char name_of_company[50];`}
int no_of_employees;
typedef struct{
int employee_id;
char name[50];
char sex;
int salary;
} employee;
employee emp[50];
printf("Create employee database for a company.\n");
printf("Enter the name of company: ");
scanf("%s",name_of_company);
printf("\nEnter no. of employees(Max. limit of 50): ");
scanf("%d",&no_of_employees);
int i=0;
int total=0;
for (i=0;i<no_of_employees;i++)
{
printf("\nEnter employee id: ");
scanf("%d",&emp[i].employee_id);
printf("\nEnter employee name with '-' between names: ");
scanf("%s",emp[i].name);
printf("\nEnter sex of employee(m/f): ");
emp[i].sex = getche();
printf("\nEnter salary of employee: ");
scanf("%d",&emp[i].salary);
total = total + emp[i].salary;
}
printf("\nPrinting database ... ");
printf("\n\t\t%s",name_of_company);
printf("\nNumber of Employees: %d",no_of_employees);
printf("\nTotal Salary of employees: %d",total);
printf("\n----------------------------------");
printf("\nID\tName\t\tSex\tSalary");
for(i=0;i<no_of_employees;i++)
{
printf("\n%d\t%s\t\t%c\t%d",emp[i].employee_id,emp[i].name,emp[i].sex,emp[i].salary);
}
getch();
return;
}

The output is shown below:
Structure Pointer Out Put

Topics in C Programming

Structures And Pointers Homework Help
Resources
24 x 7 Availability.
Trained and Certified Experts.
Deadline Guaranteed.
Plagiarism Free.
Privacy Guaranteed.
Free download.
Online help for all project.
Testimonial

Urgenthomework helped me with finance homework problems and taught math portion of my course as well. Initially, I used a tutor that taught me math course I felt that as if I was not getting the help I needed. With the help of Urgenthomework, I got precisely where I was weak:

logo

  Urgent HomeWork

Disclaimer: The study tools and academic assistance/guidance through online tutoring sessions provided by Urgenthomework.com is to help and enable students to compete academically. The website does not provide ghostwriting services and has ZERO TOLERANCE towards misuse of the services. In case any user is found misusing our services, the user's account will be immediately terminated.
Copyright © 2009-2023 UrgentHomework.com, All right reserved.