Lab#01 Task
Lab#01 Task
Lab Activity 1:
Lab Activity 2:
Learning Objective: Pointers in function call
In this activity you will have to use pointers to perform the following tasks on randomly
generated 1D array of type int having size of 20.
i. Write a function int smallest = smallest_value(int *temp, int size), which receives
an array as pointer and find out smallest value using pointer to array.
ii. Write a function void traversal_back(int *temp, int sizeofarry), which receives an
array as pointer and traverse array from last index to first index and print its value
with its address as well.
Lab Activity 3:
Learning Objectives: Operations on dynamic arrays
When we pass pointers to some function, the addresses of actual arguments in the calling
function are copied into the arguments of the called function.
Design a C program in which we declare a dynamic array of n elements and initialize it with
some random values. You have to sort all the array elements in ascending order by sending the
array to a user defined function i.e. SORTING. The prototype for the function SORTING is as
under:
Void sorting (int * ,int );
Display the unsorted and sorted array as a result.
Hint: you may build more than one functions to complete the task
Expected Output: