C Structure Programming Problems - All Types
Problem 1: Define and print a structure
Define a structure called Student with fields: name, roll, marks.
Take input for one student and display the data.
Problem 2: Array of Structures
Create an array of 5 structures for employees (name, id, salary).
Input and display all employee data.
Problem 3: Nested Structures
Create a structure Student with a nested structure Address.
Fields: Student (name, roll), Address (city, pin).
Input and display full info.
Problem 4: Pointer to Structure
Define a structure Book with title, author, and price.
Use a pointer to structure to input and print book data.
Problem 5: Structure with Function
Write a function that takes a structure variable as argument and prints its data.
Use a structure called Car with brand, model, year.
Problem 6: Structure Array + Function
Use a function to input and display data for an array of 5 structures called Product (id, name, price).
Problem 7: Compare Two Structures
Write a program to check if two structure variables of type Date (day, month, year) are equal or not.
Problem 8: Structure with typedef
Use typedef to create an alias 'Student' for a structure.
C Structure Programming Problems - All Types
Use it to declare variables and handle data.
Problem 9: Structure with dynamic memory
Create a structure Person with a pointer to name (char *).
Allocate memory using malloc, take input, and display.
Problem 10: Pass Structure by Reference
Write a function to modify a structure's values using pass-by-reference (use Employee with name, age).