Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Structure Unions Questions & Answers ★ Verified | Correct Answers | Latest 2026/2027 Update | PDF

Rating
-
Sold
-
Pages
17
Grade
A+
Uploaded on
05-01-2026
Written in
2025/2026

Prepare for Structure Unions exams with verified questions and correct answers. Fully updated for 2026/2027, covering organizational structures, union laws, roles, collective bargaining, and workplace regulations. Ideal for exam prep, assignments, and quick revision.

Show more Read less
Institution
Structure Union
Course
Structure union

Content preview

Structure:
• A structure is a user defined data type. We know that arrays can be used to represent
a group of data items that belong to the same type, such as int or float.
• However, we cannot use an array if we want to represent a collection of data items of
different types using a single name.
• A structure is a convenient tool for handling a group of logically related data items.
• Structure is a user defined data type used to represent a group of data items of
different types using a single name.
The syntax of structure declaration is
struct structure_name
{
type element 1;
type element 2;
……………..
type element n;
};
• In structure declaration the keyword struct appears first, this followed by structure
name.
• The member of structure should be enclosed between a pair of braces and it defines
one by one each ending with a semicolon.
• It can also be array of structure. There is an enclosing brace at the end of declaration
and it end with a semicolon.
• We can declare structure variables as follows
struct structure_name var1,var2,…..,var n;
Example:
• To store the names, roll number and total mark of a student you can declare 3
variables.
• To store this data for more than one student 3 separate arrays may be declared.
• Another choice is to make a structure. No memory is allocated when a structure is
declared.
• It just defines the “form” of the structure. When a variable is made then memory is
allocated. This is equivalent to saying that there's no memory for “int”, but when we
declare an integer that is int var; only then memory is allocated.
• The structure for the above- mentioned case will look like
struct student
{
int rollno;
char name[25];
float totalmark;
};
• We can now declare structure variables stud1, stud2 as follows
struct student stud1,stud2;

, • Thus, the stud1 and stud2 are structure variables of type student. The above
structure can hold information of 2 students.
• It is possible to combine the declaration of structure combination with that of the
structure variables, as shown below.
struct structure_name
{
type element 1;
type element 2;
……………..
type element n;
} var1,var2,…,varn;
• The following single declaration is equivalent to the two declaration presented in the
previous example.
struct student
{
int rollno;
char name[25];
float totalmark;
} stud1, stud2;
Accessing structure Variable
• The different variable types stored in a structure are called its members.
• The structure member can be accessed by using a dot (.) operator, so the dot operator
is known as structure member operator.

Example:
• In the above example stud1 is a structure variable of type student.
• To access the member name, we would write stud1.name.
• Similarly, stud1’s rollno and stud1’s totalmark can be accessed by writing
stud1.rollno and stud1.totalmark respectively.

Initializing Structure Members
• Structure members can be initialized at declaration.
• This much the same manner as the element of an array; the initial value must appear
in the order in which they will be assigned to their corresponding structure members,
enclosed in braces and separated by commas.
• The general form is
struct structure_name var={val1,val2,val3…..};
Example:
#include <stdio.h>
#include<conio.h>
void main()
{
struct student
{
char *name;

, int rollno;
float totalmark;
};
struct student stud1={"Venkat",1,98};
struct student stud3= {"Shweta",3,97};
struct student stud2={"Arpita",2,99};
clrscr();
printf(“STUDENTS DETAILS:\n”);
printf(“\n\n Roll number:%d\n Name:%s\n Total Marks:%f”, stud1.rollno, stud1.name,
stud1.totalmark);
printf(“\n\n Roll number:%d\n Name:%s\n Total Marks:%f”, stud2.rollno, stud2.name,
stud2.totalmark);
printf(“\n\n Roll number:%d\n Name:%s\n Total Marks:%f”, stud3.rollno, stud3.name,
stud3.totalmark);
getch();
}

Output
STUDENTS DETAILS:
Roll number: 1
Name: Venkat
Total Marks:98.000000

Roll number: 2
Name: Arpita
Total Marks:99.000000

Roll number: 2
Name:Shweta
Total Marks:99.000000

Using Typedef to declare structure variables
• Using the keyword typedef we can define any type to the easiest name that we want
to use.
• Eg. : typedef struct abc node; // this defines struct abc as node
• At any place if we write node that is equivalent to struct node. Another alternative usage
of typedef is in the definition of the data type directly.
• Eg. : typedef struct student
{
char first[10];
char last[20];
} stu_type;
• We can now use the typedef as in the following declaration:
stu_type Sname, Ename;
• A structure member can be accessed by using the following format.
struct_variable_name.member_name
• Eg : printf ("%s",sname.first);
will display first (member) from Sname(structure variable).

Written for

Institution
Structure union
Course
Structure union

Document information

Uploaded on
January 5, 2026
Number of pages
17
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$12.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
AnswersCOM Chamberlain School Of Nursing
Follow You need to be logged in order to follow users or courses
Sold
1381
Member since
3 year
Number of followers
355
Documents
26970
Last sold
1 day ago
Academic Guru

In my profile, you'll find a range of study resources, including detailed lecture notes, comprehensive summaries, and challenging practice exams. These materials are designed to help you grasp key concepts, review efficiently, and perform your best during assessments.I'm here not just to share but also to learn. Feel free to connect, ask questions, and share your insights. Together, we can make the learning journey more enriching. Browse through my materials, and I hope you find them beneficial for your academic success. Happy studying!

Read more Read less
3.6

247 reviews

5
109
4
29
3
50
2
13
1
46

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions