LAB 8- STRUCTURE AND FILE
In this lab students will learn about structure and file in C.
- Create a structure named book which has members name,pages and price. WAP to read name,no of pages of 5 books using array of structure . Display the name, no of pages and price of most expensive book.(having highest price)
- Create a structure named book which has members name,pages and price. WAP to read name,no of pages of 5 books using array of structure . Display the name, no of pages and price of most expensive book.(having highest price)
- WAP that opens a file and copies all its content to another file. Your file should read the name of the source and destination file from the user.
- WAP to take 10 integers as input and perform the following
- Display the sum of all integers
- Write odd numbers from those 10 integers to file “odd.txt”
- Write even numbers from 10 integers to file even.txt
- Read “even.txt” and “odd.txt” files and display them on screen.
- Create a structure named employee having empName, age and salary as its members . Read name,age and salary of a number of employees and write these data to a file named employee.txt . Read employee information again and again until the user wants to add more employees. Finally write a program to search information of a particular employee from the file.