// CS301P Lab 14 Problem KST Learning #include #include using namespace std; main() { int array[5] = {3, 6, 12, 18, 20}; int searchValue, mid, low, high, found = 0; cout << "Enter Search Value : "; cin >> searchValue; low = 0; high = 4; while(low <= high) { mid = (low + high) / 2; if(searchValue == array[mid]) { cout << "\n\n*** Value is Found ***"; found++; break; } if(searchValue < array[mid]) { high = mid-1; } else { low = mid+1; } } if(found == 0) { cout << "\n\n*** Value Not Found ***"; } getch(); return 0; }