Question: #1. Section 6.2 contains a C program to read a sorted array of integers from an input file and display the array. The program then
#1. Section 6.2 contains a C program to read a sorted array of integers from an input file and display the array. The program then allowed the user to search for an element in the array and displayed its position if it was found, and deleted a user specified element from the array. Finally, the program displayed the modified array.
Extend this program to do the following:
Add a method (function) called insert() which should insert an element in the appropriate place in the sorted array.
Modify the main() method (function) to allow the user the following options: Search for a key, Delete an element, Insert an element, or Exit. The main() method should loop infinitely until the user decides selects Exit. Obviously, after the user inserts an element or deletes an element, the main() method should display the modified array.
Be sure to use appropriate indentation and variable names in your program.
The code to extend:

Sample Input/Output :

main() toexample1.c #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
