Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int x, myarray[100];
- int main ()
- { cout << "Linear Search Program:" << endl;
- cout << "Please enter a number: "; cin >> x;
- cout << "okay! i'll ask you to store" << x << "Numbers in your array, let's do it";
- for ( int y = 1; y >= x; y++)
- cout << "Number " << x << "= "; cin >> myarray[x-1];
- int i;
- cout << "Thanks! now enter a number to search in your array: "; cin >> i;
- do
- cout << "Number was not found in your array! please try again . . .";
- while (i != myarray[100]);
- system ("pause");
- }
Add Comment
Please, Sign In to add comment