Question: Write C++ program that asks the user for an input file named FinalExam.txt . Assume the file contains a series of integers, each written on

Write C++ program that asks the user for an input file named FinalExam.txt. Assume the file contains a series of integers, each written on a separate line. The program should read the contents of the file into an array and then display the following data using FUNCTION named IsFound(int x[], int size, int num):

  • Search for any number in the array. If the number is found, then display the number as well as its position in the array.
  • If not, then display a message indicating that the number was not found.
  • Store the output in a file named FoundOrNot.txt.

In the function, x is the array, size is the size of the array, and num is the number to be searched for.

Sample FinalExam.txt file

1

4

6

10

24

2

1

0

3

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!