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

Lab_Assignment-11

The document outlines a lab assignment consisting of six programming tasks involving structures in C. Tasks include creating structures for points and triangles, managing student data, sorting cricketer records, bit manipulation, date storage using bit-fields, and file handling with character case conversion. Each task requires specific functions and operations to be implemented based on the given requirements.

Uploaded by

Ashok Garg
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)
3 views

Lab_Assignment-11

The document outlines a lab assignment consisting of six programming tasks involving structures in C. Tasks include creating structures for points and triangles, managing student data, sorting cricketer records, bit manipulation, date storage using bit-fields, and file handling with character case conversion. Each task requires specific functions and operations to be implemented based on the given requirements.

Uploaded by

Ashok Garg
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

Lab Assignment-11

1. Create two different structures; point and triangle. Structure point contains 2-real values
to define a point on xy-plane and triangle contains three points.
Write a program which takes three points as input and checks if the points forming a
triangle or not. If yes, then compute the length of all sides of the triangle.
2. Create a structure to specify data on students given below:
Roll number, Name, Department, Year of joining.
Assume that the data is collected for the years 2015, 2016, 2017 and 2018 for three
different departments, namely, CSE, EEE and Maths. Each department has total 10
enrollments year-wise.
a) Write a function to print names of all students who joined in a particular year.
b) Write a function to print the data of a student whose roll number is received by
the function.
3. A record contains name of a cricketer, her age, and number of test matches that she has
played and the average runs that she has scored in each test match. Create an array of
structures to hold records of 20 such cricketers and then write a program to read these
records and arrange them in ascending order by average runs. Use any sorting algorithm
of your choice.
4. Write a program to receive a 8-bit number into a variable and then check if its 3rd and
5th bits are ON or not. If these bits are found to be ON then put them off.
5. Write a program which stores information about a date in a structure containing three
members – day, month and year. Using bit-fields the day number should get stored in
first 5-bits of day, the month number in 4-bits of month and year in 12-bits of year.
Write the program to read date of joining of 10-employees and display them in
ascending order of year.
6. Write a program to copy contents of one file to another. While doing so replace all
lowercase characters to their equivalent uppercase characters.

You might also like