/* testsearch1.cpp CIS 150 David Klick 6/24/08 Demonstration of linear search. */ #include #include #include using std::cin; using std::cout; const int ARRAY_SIZE = 10; int lsearch(int n[], int len, int key); void cont(); int main() { int nums[ARRAY_SIZE]; int i, val, pos; // randomize random number generator srand(time(0)); // fill array up with random ints (0-99) for (i=0; isungetc() != -1 && cin.get() != '\n') cin.ignore(80,'\n'); cout << "Press enter to continue..."; cin.get(); } /* Sample output 11 73 65 83 66 81 27 32 70 60 72 not found 91 not found 58 not found 65 found at position 2 36 not found 44 not found 98 not found 80 not found 83 found at position 3 89 not found */