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

STRUCTURE

The document outlines tasks for writing C programs involving dynamic memory allocation and structures. It includes finding the largest element in an array, calculating distances and areas using a point structure, and managing student data with a STUDENT structure. Functions for searching and printing student details based on specific criteria are also required.

Uploaded by

s36347032
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)
5 views1 page

STRUCTURE

The document outlines tasks for writing C programs involving dynamic memory allocation and structures. It includes finding the largest element in an array, calculating distances and areas using a point structure, and managing student data with a STUDENT structure. Functions for searching and printing student details based on specific criteria are also required.

Uploaded by

s36347032
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
You are on page 1/ 1

1. Write a C program to find the largest element using dynamic memory allocation.

2. Define a structure for representing a point in two-dimensional Cartesian coordinate system.


Using this structure for a point, do the following.
a. Write a function to return the distance between two given points
b. Write a function to return the middle point of the line segment joining two given points
c. Write a function to compute the area of a triangle formed by three given points
d. Write a main function and call the functions from there after reading in appropriate inputs
(the points) from the keyboard

3. Define a structure STUDENT to store the following data for a student:


name (null-terminated string of length at most 20 chars), roll no. (integer), CGPA (float).

Then
a. In main, declare an array of 100 STUDENT structures. Read an integer n and then read in
the details of n students in this array
b. Write a function to search the array for a student by name. Returns the structure for the
student if found. If not found, return a special structure with the name field set to empty
string (just a ‘\0’)
c. Write a function to search the array for a student by roll no.
d. Write a function to print the details of all students with CGPA > x for a given x
e. Call the functions from the main after reading in name/roll no/CGPA to search

You might also like