Skip to content

Commit

Permalink
feat: add interactive/self-test modes
Browse files Browse the repository at this point in the history
  • Loading branch information
Panquesito7 committed Jan 20, 2022
1 parent be6f74b commit 82358cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions search/linear_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ int main() {
std::cout << "\nEnter the size of the array: ";
std::cin >> size;

while ((size <= 1) || (size >= 30)) {
std::cout << "Size cannot be less than zero. Please choose another value: ";
std::cin >> size;
}

int *array = new int[size];
int key = 0;

Expand Down

0 comments on commit 82358cd

Please sign in to comment.