0% found this document useful (0 votes)
13 views2 pages

Structure Problems C

The document outlines ten programming problems related to C structures, including defining and printing structures, creating arrays of structures, using nested structures, and implementing functions that interact with structures. It covers various concepts such as pointers, typedef, dynamic memory allocation, and passing structures by reference. Each problem provides specific requirements for input and output related to different types of structures.

Uploaded by

heyyanshu.07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Structure Problems C

The document outlines ten programming problems related to C structures, including defining and printing structures, creating arrays of structures, using nested structures, and implementing functions that interact with structures. It covers various concepts such as pointers, typedef, dynamic memory allocation, and passing structures by reference. Each problem provides specific requirements for input and output related to different types of structures.

Uploaded by

heyyanshu.07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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).

You might also like