Professional Documents
Culture Documents
Faculty of Engineering
Electrical and Electronics Engineering
Objectives
- To be familiar with pointers.
Equipments
- Personal Computers with devcpp installed on will be available in the laboratory.
Preliminary Work:
Task 1:
1) int A[]={0,7,3,1,4};
int *p;
p = A;
Continue the program to find the values in the table below. Use printf command.
Task 1 : First, write a function which assigns random values to an array a[10]. Then, write
a second function to find average and sum of the values of this array. In the main program,
print a) Original array, b) Average value of this array, c) Sum of the values of this array.
Use pointers while solving this problem.
Task 2 : Write a C program which is shifting an array’s values as given in the Figure 2.
Array values will define in the program code and array size can be even or odd. (Write a
function for shifting algorithm. Also use pointers for solving this problem)