Q1. “Story.txt” file contains the following story. Read the content and display it on the screen using a C program:
Q2. Read the file Story.txt (in Q1) and display the contents on screen line by line using C program.
Q3. Write a C program to illustrate how to import another file using #include. For example, few math functions are defined in a file “MyMathFunctions.c”. Your program should start with #include”MyMathFunctions.c” etc. and call the functions defined in that file.
Q4. Can you open a file both for reading and writing? What are the pros and cons of doing this?
Q5. What is the random access of a file? What is a file pointer? Practice functions seekp(), seekg(), tellp() and tellg() while reading and writing into a file.
Q6. Write a C program to count:
a) Number of characters in a file
b) Number of words in a file
c) Number of lines in a file
Q7. How would you copy the contents of a file into another file using a C program?
Q8. What are the command line arguments? Illustrate the usage of int main(int argc, char *argv[]).
Q9. Read marks500.txt to find min and max of the marks. This file can be found at on the lab assignment page: https://sites.google.com/a/thapar.edu/uta-007/ues103/lab-assignments?authuser=0
Q10. Read marks500.txt. Which roll number is the topper and print the roll numbers who failed (marks below 33)
Q11. Read marks500.txt. Find average and standard deviation of these 500 marks and save this into a new file MarksStats.txt
Q12. Make a big notepad file of thousands entries and then do some interesting data analysis. Larger text files can be found on Google for example https://archive.ics.uci.edu/datasets