Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Iqra University, Islamabad Campus

Faculty of Computing & Technology


Programming Fundamentals (CSC111)
Assignment # 3

Problem # 1: [CLO4]
Create a function named sumArray that takes an integer array and its size as parameters. Inside
the function, calculate and return the sum of all elements in the array.

Problem # 2: [CLO4]
Define a function called doubleArray that accepts a array and its size as parameters. Inside the
function, double each element of the array. In the main program, initialize a array, call the
function, and display the modified array.

Problem # 3: [CLO4]
Write a function named reverseArray that reverses the order of elements in an integer array.
Pass the array and its size as parameters. In the main program, create an array, call the function,
and print the reversed array.

Problem # 4: [CLO4]
Define a function named searchArray that takes an integer array, its size, and a target value as
parameters. The function should return the index of the target value in the array if found, or -1
if not found. In the main program, create an array, call the function with a target value, and
display the result.

You might also like