0% found this document useful (0 votes)
211 views1 page

C Programming: Structures and Unions

This document provides 5 programming assignments involving structures and unions in C programming. The assignments are: 1) Find the largest of three numbers using a structure. 2) Read and display student information for one student using a structure. 3) Define a structure to store distances in kms and meters and write functions to manipulate them. 4) Define a structure and union with the same members and compare their sizes. 5) Modify the student information program to store data for 5 students.

Uploaded by

sachin rajput
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)
211 views1 page

C Programming: Structures and Unions

This document provides 5 programming assignments involving structures and unions in C programming. The assignments are: 1) Find the largest of three numbers using a structure. 2) Read and display student information for one student using a structure. 3) Define a structure to store distances in kms and meters and write functions to manipulate them. 4) Define a structure and union with the same members and compare their sizes. 5) Modify the student information program to store data for 5 students.

Uploaded by

sachin rajput
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

C Programming – Assignment 9

Structure and Union


*WAP – Write a Program

1. WAP using structure to find the largest of three numbers.


2. WAP using structure to read and display the student information (name, roll no, dob,
marks of two subjects). Print the size of structure using sizeof operator.
3. Define structure to store the value of two distances. One distance must be defined using
kms and another distance using meters. Write user defined function to read, display, add,
and subtract two distances.
4. WAP to define a union and structure both having exactly the same members. Using the
sizeof operator, print the size of structure variable as well as union variable.
5. Modify the second program to store the information of 5 students.

You might also like