Posted in All Posts, Semester 2

Sem 2 – ACP Unit 2 Programs

ACP – Advanced C Programming

Unit 2 : Using Structures

1. Write a program to define structure with tag state with fields state name, number of districts and total population. Read and display the data.
Download | View Code

2. Write a program to create a list of books details. The details of a book include title, author, publisher, publishing year, number of pages, and price.
Download | View Code

3. Define a structure called Item with members : Item_code, Item_name, Price. Create an array of five Items. Create a function which accepts the Item array and modifies each element with an increase of 10% in the price.
Download | View Code

4. Define a structure to represent a date. Use your structures that accept two different dates in the format mm dd of the same year. Write a C program to display the month names of both dates.
Download | View Code

5. Define a structure that can describe a Hotel. It should have members that include name, address, grade, room charges, grade and no of rooms. Write a function to print out all hotel details with room charges less than a given value.
Download | View Code

6. Write a program to accept records of different states using array of structures. The structure should contain char state and number of int engineering colleges, int medical colleges, int
management colleges and int universities. Calculate total colleges and display the state, which is having highest number of colleges.
Download | View Code

7. Define a structure by name time with members seconds, minutes and hours of int type. A variable of the structure
would thus represent time. If time1 and time2 are two variables of the structure type, write a program to find the difference of two times using a function.
Download | View Code

8. Write a program to accept records of different states using array of structures. The structure should contain char state, int population, int literacy rate and int per capita income. Assume suitable data. Display the state whose literacy rate is highest and whose per capita income is highest.
Download | View Code

9. Define a structure employee with members employee name, basic pay, dearness allowance, house rent, net salary. Declare an array of 5 employees. Write a function which calculates the net salary of employees and prints all employee details in descending order of their net salary.
Download | View Code

10. Define a structure with tag population with fields Men and Women. Create structure within structure using state and population structure. Read and display the data.
Download | View Code

Download All

We hope that you found this article to be helpful.
Please share your thoughts in the Comments Section.

If you liked this article, then please like our Facebook page.

Suggested Reading

Comment your thoughts