Assignment [class 12] | Pointer | File Handling in C

POINTER

1. What is pointer? differentiate between array and pointer.
2. differentiate between structure and pointer.
3. differentiate between call by value and call by reference.
4. List operators used in pointer. Write advantages of pointer.
5. WAP to swap two numbers using pointer.
6. WAP to input 10 numbers and display them in ascending order using pointer.

FILE HANDLING IN C
MCQ
What will fopen return, if there is any error while opening file?
a) Nothing
b) EOF
c) NULL
d) Depends upon compiler

2. The presence of code like “s.t.b=10” indicates ….
a) Error
b) Structure
c) double data type
d) an ordinary vairable name.

3. What is meant by ‘a’ in the following C operation?
fp=fopen(“data.txt”,”a”);
a. attach
b. append
c. apprehend
d. add

 

Short Q/A

1. What is data file? Write syntax to open and close datafile.
2. Differentiate between sequential access and random-access techniques of data file.
3. List of File manipulation functions with syntax and example. Write function of rename() and remove() functions.

 

Long Q/A
1. Write a program to enter name, roll_no and marks of 5 students and store them in a file “student.dat” and read the records from the data file and disply the record on screen.

2. Write a progrm to store id, name and mark of n students. sort according to descending order of mark and store in datafile and display the records of datafile in proper format.

Leave a Comment