Question: Write a C program that reads a series of integer numbers and saves them into an array. Your program should then the user for an

Write a C program that reads a series of integer numbers and saves them into an array.
Your program should then the user for an integer to search within the array. If the value
exists within the array, the program should indicate where the value was found. If the
value doesnt exist in the array, the program should report that the value is not in the
array.
Requirements:
- Use pointer notation and pointer arithmetic to solve this problem.
- You can only use the [] operator to declare the array. The [] operator should not be
used anywhere else in your program.
Example Interaction (user input is underlined; your program must follow this format
precisely without the underline):
$ gcc -Wall a4_linear.c
$ ./a.out
Enter the number of input integers (0 to stop): -1
Invalid number
Enter the number of input integers (0 to stop): 0
$
$ ./a.out
Enter the number of input integers (0 to stop): 7
Enter numbers: 578014839170
20113647
What is the search number? 67
Not found: 67 is not in the array.
Enter the number of input integers (0 to stop): 0
$
$ ./a.out
Enter the number of input integers (0 to stop): 5
Enter numbers: 86
9886100-135002730
What is the search number? 86
Found: 86 is in position 0,2 in the array.
Enter the number of input integers (0 to stop): 0
$
$ ./a.out
Enter the number of input integers (0 to stop): 5
Enter numbers: 86
9886100
-13
What is the search number? -13
Found: -13 is in position 4 in the array.
Enter the number of input integers (0 to stop): 3
Enter numbers: 100
220
150
What is the search number? 20
Not found: 20 is not in the array.
Enter the number of input integers (0 to stop):
3
Enter numbers:
100
100
100
What is the search number?
100
Found: 100 is in position 0,1,2 in the array.
Enter the number of input integers (0 to stop): 0
$

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 Databases Questions!