Question: Write a recursive C function which receives an array of 10 integer elements and a key value. The function should search for the key

 Write a recursive C function which receives an array of 10 integer  elements and a key value. The function should search for the key 

Write a recursive C function which receives an array of 10 integer elements and a key value. The function should search for the key and return its index if found, otherwise it should return -1. Use linear search. In main do the following: 1. Fill in the array from user. 2. Read in a key from user. 3. Pass the array and the key to the function. 4. Print "found" and the index value if found, otherwise print "not found".

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!