Professional Documents
Culture Documents
The calendar for 1year B.Tech E.C.E C and Data Structures course
Visit us at :http://mritsece.blogspot.com
1st LAB INTERNAL EXAM 21-01-08 TO 28-01-
08
1) LAB EXPERIMENT NO 32 T0 61
2. The annual examination is conducted for 50 students for three subjects. Write
a program
to read the data and determine the following:
(a) Total marks obtained by each student.
(b) The highest marks in each subject and the Roll No. of the student who
secured it.
(c) The student who obtained the highest total marks.
3. (a) Write a ‘C’ program to compute the sum of all element stored in an array
Using pointers.
(b) How to use pointer variables in expressions? Explain through examples.
(c) Write a ‘C’ program to illustrate the use of pointers in arithmetic
operations.
Visit us at : http://mritsece.blogspot.com
4(a) Distinguish text mode and binary mode operation of file.
(b) Write a program to open a pre-existing file and add information at the End of
a file.
Display the contents of the file before and after appending.
(c) Write a C program to read data from the keyboard, write it to a file called
INPUT,
again read the same data from the INPUT file, and display it on the screen.
(5) Explain the effect of the following statements:
(i) int a, *b = &a - variable is declared as an integer variable. Variable b is
declared as a
pointer variable which is assigned to the address of the variable a
(ii) int p, *p – this will give an error while compiling since the same variable name
cannot
be used as a normal and pointer variable
(iii) char *s – this will create a pointer to string variable and name it as s. The
variable s
points to a string
(iv) a=(float*)&X – this will take the address of the variable X and assign it to the
variable
a. The contents of the variable is casted with float. Hence the contents of
variable a is a
float
6.a) Write a C program to read the information from the keyboard in which the
“Employee”
structure consists of employee name, code, designation and salary. Construct an
array of
structures that stores n employees information and write a program to carry out
operations like inserting a new entry, deleting entry.
(b). Write a C program using structure to create a library catalogue with the
following
fields: Access number, Author’s name, Title of book, Year of publication,
MALLAREDDY INSTITUTE OF TECHNOLOGY AND SCIENCE
The calendar for 1year B.Tech E.C.E C and Data Structures course
Publisher’s name, Price.
c). Write a program to detect error while opening a file that does not exist.