LabWorks Objectives
LabWorks Objectives
1. Students are advised to prepare handwritten lab works. Cover page should be
printed.
2. Students should describe the theoretical part as per the objective of the lab on
the theoretical background section.
3. Students should write a program for each question. The output of the program
should be printed with the proper author name, program description and stick with
glue on the back side of the page.
4. Students should submit the lab work/report on the next lab day. Violation of any
rules result in late submission or need to rewrite the report.
*************************************
Lab Objectives
Lab Questions
Lab Objective
1. To understand the concept of RDBMS, Server Application and Services.
2. To understand Create a database and Table in database.
3. To understand DDL Command (CREATE, ALTER, DROP)
4. To understand DML Commands (INSERT, UPDATE, DELETE)
5. To understand DQL Commands (SELECT)
----- C PROGRAMMING------
Objectives
1. WAP to input a sentence and store data in a data file “file.txt”. And print them
on screen. Use getc() and putc() functions.
2. WAP to store some ‘n’ natural numbers in a data file and print them on screen.
Use getw() function. Also print their average.
3. WAP to store student’s name and address in a data file “student.txt”. Use
fprintf() function.
Then read contents of data file and print them on screen. Use fscanf() function.
4. WAP to store book’s name, edition and price in a data file “book.txt” using
yes/no options. It means the computer stores data until you say ‘n’. Then print
them on screen.
6. WAP to input students’ name, grade and marks in five subjects. Then store these
all data with total and percentage in a data file “student.dat”. Print all those
data of students who have percentage >=80. You may use fscanf() or fwrite().
Objective
1. To become familiar with the concept of a pointer.
2. To understand that variables are stored in memory locations that can be referred
to by their addresses.
3. To understand Pointer and Array
4. To understand passing pointer as function argument
Lab Work
Lab Objectives:
1. To understand declaration and initialization of structure in C.
2. To understand accessing structure members.
3. To understand the concept of nested structure.
4. To understand concept of array using structure.
5. To understand passing structure as a function argument.
6. To understand the concept of Union.
Lab Works
1. WAP to input id, name and grade for 5 students. Then print them. Use array of
structure concept.
2. WAP to input 5 employees name, position and salary. Then search a record of an
employee and its position on the basis of name.
3. We have two structures as given below.struct employee{ char ename[100]; char
eaddress[100];};struct salarydetails{char pos[100];float salary;struct employee
detail;}payinfo; WAP to input employees’ details with salarythen print them. Use
nested struct concept.
4. WAP to input id, name and address of 20 studentsusing struct. Then print them in
sorted format on the basis of name.
5. WAP to input any 10 teacher’s id, name and subject using ‘typedef’ and
structure. Then print them on screen.
6. WAP using function and structure to calculatesum of two distances measured in
terms of kilometers and meters.
For example, If we input following data
Kilometer meter
23 445
45 756
69 201
The output would be 69 km and 201 meters.
7.WAP to input student id, name and grade and print them. Use union concept.
Lab Objectives
Lab Works