re-write this program so that it searches an array of integers rather than characters. search the integer array nums[8]

Respuesta :

A group of comparable data elements in program kept in close proximity to one another in memory is called an array. It is the most basic data structure because each data element can be directly accessed by using only its index number.

What is program?

A computer program is a set of instructions, and the term itself can be used both as a verb and a noun. It is used as a verb to describe the act of developing software by using a programming language. An application, program, or application software is a noun used to describe the process of carrying out a particular task on a computer.

An application like Microsoft PowerPoint, for instance, offers a means of producing presentation-related documents. We can browse any website using a browser, which is also an application.

The  program that searches an array of integers rather than characters is here:

// This program performs a linear search on a character array

// Insert Name Here

#include <iostream>

using namespace std;

int searchList(int[], int, int); // function prototype

const int SIZE = 8;

int main()

{

int numbers[SIZE] = {3, 6, -19, 5, 5, 0, -2, 99};

int found;

int num;

cout << "Enter a integer to search for:" << endl;

cin >> num;

found = searchList(numbers, SIZE, num);

if (found == -1)

cout << "The number " << num

<< " was not found in the list" << endl;

else

cout << "The number " << num << " is in the " << found + 1

<< " position of the list" << endl;

return 0;

}

//*******************************************************************

// searchList

//

// task: This searches an array for a particular value

// data in: List of values in an array, the number of

// elements in the array, and the value searched for

// in the array

// data returned: Position in the array of the value or -1 if value

// not found

//

//*******************************************************************

int searchList(int List[], int numElems, int value)

{

for (int count = 0; count <= numElems; count++)

{

if (List[count] == value)

// each array entry is checked to see if it contains

// the desired value.

return count;

// if the desired value is found, the array subscript

// count is returned to indicate the location in the array

}

return -1; // if the value is not found, -1 is returned

}

Learn more about program

https://brainly.com/question/26134656

#SPJ4