Professional Documents
Culture Documents
1. 2. 3. 4. 5.
PROGRAM
Progarm to create a single file and then display its contents. Program to use multiple files in succession. Program to use multiple files simultaneously. Program for reading and writing class objects. Program to implement searching ina file that has records maintained through structures.
SIGN.
6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26.
Program to append data in a file. Program to insert data in a sorted file. Program to delete a record from a file. Program to modify data in a given file. Program to perform linear search. Program to perform binary search. Program to perform insertion in an array. Program to perform deletion in an array. Program to perform traversal in an array. Program to perform bubble sort in an array. Program to perform insertion sort in an array. Program to perform insertion in the beginning of a list. Program to perform insertion in the end of a list. Program to perform deletion from the beginning of list. Program to perform traversal in a list. Pushing in Stack-Array. Popping from Stack-Array. Pushing in linked-Stack. Popping from linked stack. Insertion in Array-Queue. Insertion in linked-Queue.
5.Program to implement searching in a file the has records maintained through structures.
#include<iostream.h> #include<fstream.h> Struct stu{ Int rollno; Char name[25]; Char class[4]; Float marks; Char grade; }s1; Int main() { Int rn, char found=n; Ifstream fi(stu.dat,ios::in); Cout<<Enter roll no. to be searched for:; Cin>>rn; While(!fin.eof()) { Fi.read((char*)&s1,sizeof(s1); If(s1.rollno==rn) { Cout<<s1.name<<,rollno<<rn<<has<<s1.marks<<%marks and<<s1.grade<<grade.<<endl; Found=y; Break; } } If(found==n) Cout<<rollno not found in file!!<<endl;