0% found this document useful (0 votes)
55 views

Array Function

The document outlines 3 exercises for a lab: 1) Write a program with a function to sum the elements of an integer array. 2) Write a program with a function to search an integer array for a given integer and report whether it is found. 3) Write a program with a function to print an integer array in ascending order. For each exercise, the program should get array elements from the user and call the corresponding function.

Uploaded by

kedir
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Array Function

The document outlines 3 exercises for a lab: 1) Write a program with a function to sum the elements of an integer array. 2) Write a program with a function to search an integer array for a given integer and report whether it is found. 3) Write a program with a function to print an integer array in ascending order. For each exercise, the program should get array elements from the user and call the corresponding function.

Uploaded by

kedir
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Lab Exercise

1. Write a program with a function that takes an array of integer parameters, and then returns their sum. The
program should ask the user to enter the elements of the array, and then call the function with the array as
arguments, and tell the user the sum.
2. Write a program with a function that takes an array of integer and an integer V as parameters, and then the
function must search if V is in the array of integers. The function writes "V is in the array" or "V is not in
the array". The program should ask the user to enter the elements of the array and an integer V, and then
call the function with the array and an integer V as arguments.
3. Write a program with a function that takes an array of integer as parameters, and then prints out the array in
ascending order. The program should ask the user to enter the elements of the array, and then call the
function with the array as arguments.

Lab Exercise

1. Write a program with a function that takes an array of integer parameters, and then returns their sum. The
program should ask the user to enter the elements of the array, and then call the function with the array as
arguments, and tell the user the sum.
2. Write a program with a function that takes an array of integer and an integer V as parameters, and then the
function must search if V is in the array of integers. The function writes "V is in the array" or "V is not in
the array". The program should ask the user to enter the elements of the array and an integer V, and then
call the function with the array and an integer V as arguments.
3. Write a program with a function that takes an array of integer as parameters, and then prints out the array in
ascending order. The program should ask the user to enter the elements of the array, and then call the
function with the array as arguments.

Lab Exercise

1. Write a program with a function that takes an array of integer parameters, and then returns their sum. The
program should ask the user to enter the elements of the array, and then call the function with the array as
arguments, and tell the user the sum.
2. Write a program with a function that takes an array of integer and an integer V as parameters, and then the
function must search if V is in the array of integers. The function writes "V is in the array" or "V is not in
the array". The program should ask the user to enter the elements of the array and an integer V, and then
call the function with the array and an integer V as arguments.
3. Write a program with a function that takes an array of integer as parameters, and then prints out the array in
ascending order. The program should ask the user to enter the elements of the array, and then call the
function with the array as arguments.

You might also like