Question: The following program allow the user to enter elements of an array and search for key using linear search, where the program will print
The following program allow the user to enter elements of an array and search for key using linear search, where the program will print the position of first occurrence of the key or the key not found. What are the missing statements for the program to do its job? #include int main() { int array[100], search, c, n; printf("Enter number of elements in array "); scanf("%d", &n); printf("Enter %d integer(s) ", n); if (c == n) printf("key isn't present in the array. ", search); return 0;
Step by Step Solution
3.38 Rating (164 Votes )
There are 3 Steps involved in it
The program provided in the image aims to implement a linear search algorithm where elements of an array are entered by the user and then the program ... View full answer
Get step-by-step solutions from verified subject matter experts
