subject
Computers and Technology, 19.02.2020 03:31 xcapo1x

Array manipulationWrite the following array functions. You can assume that these are integer arrays. You implementation should not use [ ] operators. Instead use pointers to access array elements. Suppose, arr[] = {1, 4, 6, 5, 2, 7, 10}.A. Search for a given value in the array and return the index of the location. Return - 1 if not found in the array. void search(int arr[], int n, int val); Using the above array arr, search(arr, 7, 6) should return 2, and search(arr, 7, 8) should return -1.B. Reverse the contents of the array. void reverse(int arr[], int n); Using the above array arr, reverse(arr, 7) should return result in arr contents rearranged as follows: arr = {10, 7, 2, 5, 6, 4, 1}.C. Rearrange the array such that all the odd elements in the array are in the beginning of the array. void oddFirst(int arr[], int n); Using the above array arr, oddFirst(arr, 7) should return result in arr contents rearranged as follows: arr = {1, 5, 7, 4, 6, 2, 10}.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, babbybronx
Lisa’s company, abc ltd., lost its biggest client and is now facing a financial crunch. most of her colleagues have resigned, but lisa decides to stay with the company and assist the management in overcoming the financial situation. which quality is lisa demonstrating? a. self-management b. cooperativeness c. responsibility d. loyalty
Answers: 2
image
Computers and Technology, 22.06.2019 22:40, nsuleban9524
When you type the pwd command, you notice that your current location on the linux filesystem is the /usr/local directory. answer the following questions, assuming that your current directory is /usr/local for each question. a. which command could you use to change to the /usr directory using an absolute pathname? b. which command could you use to change to the /usr directory using a relative pathname? c. which command could you use to change to the /usr/local/share/info directory using an absolute pathname? d. which command could you use to change to the /usr/local/share/info directory using a relative pathname? e. which command could you use to change to the /etc directory using an absolute pathname? f. which command could you use to change to the /etc directory using a relative pathname?
Answers: 3
image
Computers and Technology, 23.06.2019 00:00, addisonrausch
What season was better from fortnite?
Answers: 2
image
Computers and Technology, 23.06.2019 02:00, mayapril813
Consider the following function main: int main() { int alpha[20]; int beta[20]; int matrix[10][4]; . . } a. write the definition of the function inputarray that prompts the user to input 20 numbers and stores the numbers into alpha. b. write the definition of the function doublearray that initializes the elements of beta to two times the corresponding elements in alpha. make sure that you prevent the function from modifying the elements of alpha. c. write the definition of the function copyalphabeta that stores alpha into the first five rows of matrix and beta into the last five rows of matrix. make sure that you prevent the function from modifying the elements of alpha and beta. d. write the definition of the function printarray that prints any onedimensional array of type int. print 15 elements per line. e. write a c11 program that tests the function main and the functions discussed in parts a through d. (add additional functions, such as printing a two-dimensional array, as needed.)
Answers: 3
You know the right answer?
Array manipulationWrite the following array functions. You can assume that these are integer arrays....

Questions in other subjects:

Konu
Computers and Technology, 03.11.2020 20:10
Konu
Mathematics, 03.11.2020 20:10