VIDHYADEEP UNIVERSITY
VIDHYADEEP INSTITUTE OF ENGINEERING
AND TECHNOLOGY
Vidhyadeep Campus, Anita (Kim), Ta. Olpad, Dist. Surat
Subject Name: Data Structure
Sem:3rd
Code: 002304301
Assignment_1
INTRODUCTION TO ADVANCE C
1. Explain the difference between primitive and non-primitive data types in C, with two
examples each. Discuss how each is stored in memory.
2. Differentiate between linear and non-linear data structures. Give two real-world
examples of each and explain where they might be used.
3. Write a C program to swap the values of two integers using pointers. Explain step-bystep how the memory addresses are manipulated.
4. Given an integer array of size 5, write a program to print all elements using pointer
arithmetic (without using array index notation).
5. Define a structure to store student details (Name, Roll No, Marks in 3 subjects). Write
a program to:
a. Input data for 5 students
b. Calculate and display their average marks
(Use array of structures.)
6. Create a nested structure for a company employee that includes personal details and
job details. Write a program to input and display all details.
7. Explain the difference between static memory allocation and dynamic memory
allocation in C, including examples and memory regions used.
8. Write a program to:
a. Allocate memory for an array of integers using malloc
b. Allocate memory for an array of integers using calloc
c. Initialize values, print them, and compare the default initialization behavior.
Subject Coordinator
H.O.D. (Computer)
PREPARED BY:
Dr. Sushma D. Ghode
COMPUTER ENGINEERING
DEPARTMENT
1