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

Unit 4

Uploaded by

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

Unit 4

Uploaded by

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

CEUC101-Computer Concepts & Programming Programming Roll Number:________

_______________________________________________________________________________________________

Date:_______________________________

Academic Year : 2024-25 Semester : 1st


Course code : CEUC101 Course name : Computer Concepts And Programming

UNIT-5 Structure & Unions

Practical 24 to 26

Questions(Handwritten):
1. Why are structures and unions important in programming? Provide examples, such as
using a structure to store student data (name, roll number, marks) or a union to efficiently
manage memory for a variable that stores multiple data types at different times.

--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
-------------------

2. What are the key differences between structures and unions in terms of memory
usage and access to members? Provide a scenario where a structure is preferred (e.g.,
storing employee details) and where a union is more suitable (e.g., managing a variable
that alternates between data types).

---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
CEUC101-Computer Concepts & Programming Programming Roll Number:________
_______________________________________________________________________________________________

---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
-----------------------------

3. How are structure and union variables declared and accessed? Explain with an example,
such as declaring a structure variable for storing a book's details (title, author, price) or a
union variable for managing sensor data (integer ID or float value).

-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------

You might also like