You are on page 1of 2

DOKUZ EYLUL UNIVERSITY

Faculty of Engineering
Electrical and Electronics Engineering

Dokuz Eylül Üniversitesi, Mühendislik Fakültesi,


Elektrik Elektronik Mühendisliği, TR35160, Kaynaklar, Buca / İZMİR

EED 1005 Introduction to Programming Laboratory #10

Student Name: Student ID:

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.

For all questions, explain the results.

EED1005 Introduction to Programming Laboratory Fall 2016 – 2017 1


Laboratory Study:

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.

Figure 1: Output of Task1

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)

Figure 2: Shifting algorithm

Figure 3: Outputs of Task2

EED1005 Introduction to Programming Laboratory Fall 2016 – 2017 2

You might also like