Professional Documents
Culture Documents
Skill 05writeup
Skill 05writeup
SKILL EXERCISE: 05
Title: Pointers
Ques1)
Accept 10 integer values from the user into the array num
Then we pass the integer array and its size as a parameter to the function
count
We traverse through the array and increment integer variable k if an
element is even
Return the value of k
Ques2)
We create a double array of 25 elements and accept the values from the
user
Then we pass the array and its size as a parameter to the max_value()
function
We create a double variable max initialized to 0 and double pointer m that
points towards the maximum value
We traverse through the array and if the value of the element is greater
than the value of max variable we assign its value to max and its address to
m. (Repeat this process for all the iterations)
The double pointer m is returned.
3. What resources / Materials / equipment / tools did you use for this activity?
a) Codeblocks
b) Lecture notes
4) What skills did you acquire?
Use of pointers in c programming
5) Time taken to complete the activity?
3 hrs