how to search a specific number within array
Hi guys, please take a look at my code and tell me whats wrong, i wanna give the user input to search weather that number is available inside the random numbers or not. #include <iostream> #include <cstdlib> #include <time.h> //included for srand(time(NULL)) using namespace std; int main() { int input; int number; int row = 0; int col = 0; int Array[12]; srand(time(NULL)); //PrintArray for (row = 0; row < 12; row++) { { Array[row] = rand() % (100 - 0) + 0; } cout << Array[row] << "\t"; } cout << "" << endl << endl; cout << "--------------------------------------------------------------------------------" << endl << endl; int numberSearch,numbersToEnter; cout << "Enter Number Between 0-99 To Search In The Array: "; cin >> numberSearch; for(int i=0; i<numberSearch; i++) { if (numberSearch == Array[12]) { cout << "The number you searched is: " << numberSearch << endl; cout << "The number is in the array\n"; } } }