Syed Shams Haider 203 Lab Report 01
Syed Shams Haider 203 Lab Report 01
Lab tasks
5.1. Write a program that declares a structure to store book Id, price and pages of a
book. The structure should include functions to assign user defined values to each book
and display the record of most costly book.
5.2. Write a program to take the values of two integers and use pointers to add 10 to the
value of each integer.
5.3. Write a function that swaps the values of two integer variables
a. using pass by value
b. and pass by reference and see their differences.
Home tasks
Task 01
There is a structure called employee that holds information like employee code, name,
date of joining. Write a program to create an array of the structure and enter some data
into it. Then ask the user to enter current date. Display the names of those employees
whose tenure is 3 or more than 3 years according to the given current date.
TASK 02
Write a function to sort data (in increasing order) in an array using
a. pass by value
b. and pass by reference
Task 03
Write a program that inputs a string value from the user and displays it in reverse using
pointer.