C PROGRAMMING
MULTIPLE CHOICE QUESTION
OLD QUESTION BANK
SAMPLE QUESTION 2080 AND SOLUTION

                                 LAB 8- STRUCTURE AND FILE

In this lab students will learn about structure and file in C.

  1. 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)
  2. 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)
  3. 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.
  4. WAP to take 10 integers as input and perform the following
  1. Display the sum of all integers
  2. Write odd numbers from those 10 integers to file “odd.txt”
  3. Write even numbers from 10 integers to file even.txt
  4. Read “even.txt” and “odd.txt” files and display them on screen.
  1.  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.