Write a program that will define an integer array test[] of size 10.
The program will read values into the array test[] through keyboard
from the user. After reading into the array test[] the program will
prompt the user to "Enter a value to be searched:". In response,
the user will enter a value through keyboard and the program will store
the value in an integer variable value. The program will then pass the
array test[] and the variable value to a function find(). The function
find() will search the array test[] for the given element value. If the
element was found then a message "The element was found and the
location is "is displayed. If the element was not found then a
message "The element was not found." is displayed. The result is
displayed in the find() function.
Hints
· There is an integer variable value and an array test[] of size 10.
· Pass the array to the find() function by reference but pass the
variable value by value.
· The function find() takes two parameters (i.e. an integer array and
an integer variable value) but returns no value (i.e. void).
Sample Output
Enter values into array
17
21
34
31
44
23
78
21
66
35
Enter a value to be searched: 23
The element was found and the location is 6
Enter values into array
29
22
36
30
54
63
78
21
26
85
Enter a value to be searched: 23
The element was not found.