0% found this document useful (0 votes)
23 views

Assignment 5

The document outlines 6 programming assignments involving structures in C. Assignment 1 has students store and display student data using structures. Assignment 2 adds distances in inches and feet using structures. Assignment 3 passes structures to a function to add complex numbers. Assignment 4 uses structures to calculate time period differences. Assignment 5 stores and prints an array of student structures using pointers. Assignment 6 demonstrates a union of first and last name arrays and an enum for fan speed levels.

Uploaded by

Nada A. Amin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Assignment 5

The document outlines 6 programming assignments involving structures in C. Assignment 1 has students store and display student data using structures. Assignment 2 adds distances in inches and feet using structures. Assignment 3 passes structures to a function to add complex numbers. Assignment 4 uses structures to calculate time period differences. Assignment 5 stores and prints an array of student structures using pointers. Assignment 6 demonstrates a union of first and last name arrays and an enum for fan speed levels.

Uploaded by

Nada A. Amin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment 5:

1. C Program to store information (name, roll and


marks) for a student using structure and display it.

2. C Program to add two distances (inch-feet) using


structure and display the result.

3. C function to add two complex numbers by passing


two structure to a function and display the results.

4. C Function to calculate the difference between two


time periods using structures.

5. C Function to store information (name, id and grade) for 10


students in array of structures using pointers and another
function to print all the structures using pointers.

6. Create Union type called family_name it shall have two


members first_name and last_name. The two members are
array of characters with same size 30. Try to write string in
the first member first_name then print the second member
last_name plus print the size of the union.
7. Create enum type called fan_level it shall have three values
Level1, Level2 and Level3. This enum shall be used to
control the level of the fan.

Thanks and Good Luck


Eng / Mohamed Tarek

You might also like